PublicShow sourcerdfs.pl -- RDFS handling

This module provides various primitives for more high-level handling of RDF models from an RDFS viewpoint. Note that there exist two approaches for languages on top of RDF:

Source rdfs_subproperty_of(+SubProperty, ?Property) is nondet
rdfs_subproperty_of(?SubProperty, +Property) is nondet
Query the property hierarchy.
Source rdfs_subclass_of(+Class, ?Super) is nondet
rdfs_subclass_of(?Class, +Super) is nondet
Generate sub/super classes. rdf_reachable/3 considers the rdfs:subPropertyOf relation as well as cycles. Note that by definition all classes are subclass of rdfs:Resource, a case which is dealt with by the 1st and 3th clauses :-(

According to production 2.4 "rdfs:Datatype", Each instance of rdfs:Datatype is a subclass of rdfs:Literal.

Source rdfs_individual_of(+Resource, +Class) is semidet
rdfs_individual_of(+Resource, -Class) is nondet
rdfs_individual_of(-Resource, +Class) is nondet
Generate resources belonging to a class or classes a resource belongs to. We assume everything at the `object' end of a triple is a class. A validator should confirm this property.

rdfs_individual_of(+, -) does not exploit domain and range properties, deriving that if rdf(R, P, _) is present R must satisfy the domain of P (and similar for range).

There are a few hacks:

  • Any resource is an individual of rdfs:Resource
  • literal(_) is an individual of rdfs:Literal
Source rdfs_label(+Resource, -Label)
rdfs_label(-Resource, +Label)
Convert between class and label. If the label is generated from the resource the it uses both rdfs:label and its sub-properties, but labels registered with rdfs:label are returned first.
Source rdfs_label(+Resource, ?Lang, -Label) is multi
rdfs_label(+Resource, ?Lang, +Label) is semidet
rdfs_label(-Resource, ?Lang, ?Label) is nondet
Resource has Label in Lang. If Resource is nonvar calls take_label/3 which is guaranteed to succeed label.
Source rdfs_ns_label(+Resource, -Label) is multi
Source rdfs_ns_label(+Resource, ?Lang, -Label) is multi
Present label with namespace indication. This predicate is intended to provide meaningful short names applicable to ontology maintainers. Note that this predicate is non-deterministic if the resource has multiple rdfs:label properties
Source rdfs_class_property(+Class, ?Property)
Enumerate the properties in the domain of Class.
Source rdfs_member(?Element, +Set)
As Prolog member on sets. Operates both on attributes parsed as parseType="Collection" as well as on Bag, Set and Alt.
Source rdfs_list_to_prolog_list(+RDFSList, -PrologList)
Convert ann RDFS list (result from parseType=Collection) into a Prolog list of elements.
Source rdfs_assert_list(+Resources, -List) is det
Source rdfs_assert_list(+Resources, -List, +DB) is det
Create an RDF list from the given Resources.
Source rdfs_find(+String, +Domain, ?Properties, +Method, -Subject)
Search all classes below Domain for a literal property with that matches String. Method is one of
  • substring
  • word
  • prefix
  • exact

domain is defined by owl_satisfy from owl.pl

Note that the rdfs:label field is handled by rdfs_label/2, making the URI-ref fragment name the last resort to determine the label.

Source rdfs_ns_label(+Resource, -Label) is multi
Source rdfs_ns_label(+Resource, ?Lang, -Label) is multi
Present label with namespace indication. This predicate is intended to provide meaningful short names applicable to ontology maintainers. Note that this predicate is non-deterministic if the resource has multiple rdfs:label properties
Source rdfs_assert_list(+Resources, -List) is det
Source rdfs_assert_list(+Resources, -List, +DB) is det
Create an RDF list from the given Resources.