Did you know ... Search Documentation:
Pack sparqlprog -- prolog/sparqlprog/owl_util.pl
PublicShow source

This module provides predicates for working with OWL ontologies. Although OWL ontologies can be accessed directly via rdf/3 triples, this can be quite a low level means of access, especially for ontologies employing constructs that map to multiple triples, including:

Note on use outside sparqlprog

Although this is distributed with sparqlprog, it can be used directly in conjunction with an in-memory triplestore.

 label_of(?Label, ?X) is nondet
 label_of(?Label, ?X, ?Lang) is nondet
 triple_axiom(?I, ?P, ?J, ?A) is nondet
 triple_axiom_annotation(?T, ?P, ?V) is nondet
 triple_axiom_annotation(?I, ?P1, ?J, ?P, ?V) is nondet
 triple_axiom_annotations(?I, ?P, ?J, ?L) is nondet
 triple_property_axiom_annotations(?I, ?P, ?J, ?P1, ?L:list) is nondet
for a triple IPJ, yield all axiom annotation values for annotation property P1
 axiom_annotation(?Axiom, ?Property, ?Value) is nondet
Axiom is always a blank node

See https://www.w3.org/TR/owl2-primer/#Annotating_Axioms_and_Entities

 not_thing_class(?X) is nondet
true unless X is owl:Thing
 deprecated(?X) is nondet
true if X has a owl:deprecated axiom with value true
 owl_equivalent_class(?A, ?B) is nondet
inferred equivalent class between A and B, exploiting transitivity and symmetry
 owl_equivalent_class_asserted(?A, ?B) is nondet
only holds if the assertion is in the direction from A to B
 owl_equivalent_class_asserted_symm(?A, ?B) is nondet
inferred equivalent class between A and B, exploiting symmetry
 subclass_cycle(?A) is nondet
true if there is a path between A and A following one or more subClassOf links
 bnode_signature(?N, ?X) is nondet
true if X is in the signature of the construct defined by blank node N
 owl_some(?Restr, ?Property, ?Obj) is nondet
true if Restr is a blank node representing OWL expression SomeValuesFrom(Property,Obj)
 subclass_of_some(?Cls, ?Property, ?Obj) is nondet
true if Cls is a subclass of the expression SomeValuesFrom(Property,Obj)
 owl_all(?Restr, ?Property, ?Obj) is nondet
true if Restr is an OWL expression AllValuesFrom(Property,Obj)
 owl_node_info(?S, ?P, ?O, ?E) is nondet
 class_genus(?C, ?G) is nondet
true if C EquivalentTo .... and .... and G and ...
 class_differentia(?C, ?P, ?Y) is nondet
true if C EquivalentTo .... and .... and (P some Y) and ...
 eq_intersection_member(?C, ?M) is nondet
true if C EquivalentTo .... and .... and M and ...
 intersection_member(?I, ?M) is nondet
true if I is a blank node representing an intersection, and M is a member of the list
 rdflist_member(?L, ?M) is nondet
see also rdfs_member/2

this is an alternate implementation that makes the expansion to an rdf list explicit

 common_ancestor(?X, ?Y, ?A) is nondet
MAY MOVE TO ANOTHER MODULE
 mrca(?X, ?Y, ?A) is nondet
most recent common ancestor

MAY MOVE TO ANOTHER MODULE

 common_descendant(?X, ?Y, ?D) is nondet
MAY MOVE TO ANOTHER MODULE
 mrcd(?X, ?Y, ?D) is nondet
MAY MOVE TO ANOTHER MODULE
 owl_edge(?S, ?P, ?O, ?G) is nondet
 owl_edge(?S, ?P, ?O) is nondet
An edge in an existential graph
Either: S SubClassOf O Or: S SubClassOf P some O Or: S EquivalentTo O Or: S type O
 owl_subgraph(+Nodes:list, +Preds:list, ?Quads:list, +Opts:list) is det
traverses owl edge graph starting from a predefined set of nodes
 extract_subontology(?Objs, ?G, ?Opts) is nondet
 quads_objects(?Quads, ?Objs) is nondet
 quads_dict(?Quads, ?Dict) is nondet
 ensure_curie(+Uri, ?CurieOrUriTerm) is det
translates URI to a CurieOrUriTerm
 subsumed_prefix_namespace(?Pre, ?NS, ?Pre2, ?NS2) is nondet
 ensure_uri(+CurieOrUriTerm, ?Uri) is det
translates CurieOrUriTerm to a URI. CurieOrUriTerm is either:
  • a Uri atom
  • a Pre:Post CURIE term
  • an atom of the form 'Pre:Post'
 simj_by_subclass(?C1, ?C2, ?S) is nondet
 simj_by_subclass(?C1, ?C2, ?S, ?N1, ?N2) is nondet

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 enlabel_of(Arg1, Arg2)
 declare_shacl_prefixes
 triple_axiom(Arg1, Arg2)
 thing_class(Arg1)
 owl_edge(Arg1, Arg2, Arg3)
 assert_named_individuals
 assert_named_individuals_forall
 label(Arg1, Arg2)
 subClassOf(Arg1, Arg2)