Closed danbri closed 2 years ago
@danbri
The owl-rl project can operate in RDFS mode, which will expand a graph to inference all RDFS axioms including subClassOf
and subPropertyOf
. To answer your first question, I believe all graph expanders built on rdflib use the transitiveClosure()
mechanism.
I see in your examples you're using PySHACL. Note, pySHACL has owl-rl
built in, you can expand your graph before validation automatically using inference="rdfs"
when calling validate()
.
I'm working with @Gnomus042 on SHACL/ShEx topics and we had need to update a Graph to explicitly add all the implied rdfs:subClassOf arcs. We found two approaches, one using transitiveClosure(), and the other using SPARQL .query():
Working examples - https://colab.research.google.com/drive/1DWrR-VKus4elIJ2lpHy7BXw7Jhk5qmDH?usp=sharing
Can you advise on which is preferred, or whether there is some other built-in or nearby extension to perform such tasks (and related inference e.g. subPropertyOf etc). I searched around but couldn't find clear guidance. Thanks for any pointers!