|
Dear Jean-Babtiste,
we are still using Owlready2 Version 0.10 for quite a while now, and today came across the following question:
Why, in the below code excerpt, in the 'accepted_predicates', we do not find "min" / "max" / "exactly"?
And does this have to do with the storids with ‘_’ (underscore), with respect to which you explained me a while ago, that they are used for blank nodes in version 0.10?
def _get_general_axioms_storid(self, id_) -> set:
"""
Get the storids for the general axioms for which the class with the given storid can be found on the Righthand Side of the axiom.
:param id_: the id (storid) of the axiom
:return: set of axioms
"""
accepted_predicates = {
owlready2.rdf_first,
owlready2.rdf_rest,
owlready2.owl_onclass,
owlready2.SOME,
owlready2.owl_unionof,
owlready2.owl_intersectionof,
owlready2.owl_equivalentclass}
axioms = set()
stack = [(triple, []) for triple in self.raw.get_triples(None, None, id_)]
while len(stack) > 0:
(subject, predicate, object_), chain = stack.pop(0)
chain.append((subject, predicate, object_))
if predicate == owlready2.rdfs_subclassof and \
(
(isinstance(subject, str) and (subject.startswith("_") or object_.startswith("_"))) or
(isinstance(subject, int) and (subject < 0 or object_ < 0))
):
axioms.add(Axiom(subject, object_))
elif predicate in accepted_predicates:
stack.extend((triple, chain[:]) for triple in self.raw.get_triples(None, None, subject))
return axioms
Thanks again in advance for any help!
Best
Nicolai
|