rdfs.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:
- Provide new predicates according to the concept of the high level language (used in this module)
- Extend rdf/3 relation with triples implied by the high-level semantics. This approach is taken by ClioPatria.
- rdfs_subproperty_of(+SubProperty, ?Property) is nondet
- rdfs_subproperty_of(?SubProperty, +Property) is nondet
- Query the property hierarchy.
- 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.
- 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 ifrdf(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
- rdfs_individual_of_r_c(+Resource, ?Class) is nondet[private]
- 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.
- 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.
- rdfs_ns_label(+Resource, -Label) is multi
- 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
- take_label(+Resource, ?Lang, -Label) is multi[private]
- Get the label to use for a resource in the give Language. First tries label_of/3. If this fails, break the Resource over # or / and if all fails, unify Label with Resource.
- label_of(+Resource, ?Lang, ?Label) is nondet[private]
- True if
rdf_has(Resource, rdfs:label, literal(Lang, Label))
is true, but guaranteed to generate rdfs:label before any subproperty thereof. - rdfs_class_property(+Class, ?Property)
- Enumerate the properties in the domain of Class.
- 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.
- rdfs_list_to_prolog_list(+RDFSList, -PrologList)
- Convert ann RDFS list (result from parseType=Collection) into a Prolog list of elements.
- rdfs_assert_list(+Resources, -List) is det
- rdfs_assert_list(+Resources, -List, +DB) is det
- Create an RDF list from the given Resources.
- 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.
- rdfs_ns_label(+Resource, -Label) is multi
- 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
- rdfs_assert_list(+Resources, -List) is det
- rdfs_assert_list(+Resources, -List, +DB) is det
- Create an RDF list from the given Resources.