I tried having my ontologies in different worlds and in the same world, but in both cases I got a lot more results than I should have. I then tried subtracting the graph of the ontology from itself like this:
... and I did not get an empty result, as I would expect, but still something that looked like the entire triple store. (Same result using XOR ^.) So I wondered if this may be due to owlready's implementation of the rdfgraph? I remember there being issues with that before.
If not, what else can I try?
Also, this is likely my last post here. I would like to thank you for the *excellent* support this package receives!
I tried with a few ontologies of mine, using 2 different worlds, but I get no difference.
You may be interested by the script "ntriples_diff.py" in the sources of Owlready. It can be used to diff NTriple files, and it is used for testing Owlready. If you save your ontologies as NTriples files, you can use it to diff the files.
Looking at the script (and not yet completely up to speed with either owl or owlready :-) it looks like this is finding differences that involve the renaming of classes / properties? I am looking into the subject of "diffing" ontologies and I found also the concept of structural equivalence (identifying when the overall graph structure has changed). Both seem useful to have.
Yes, the script is comparing NTriples files. Small differences (e.g. different names for blank nodes, different triple orders, etc) are not considered. However, more complex structural differences are (e.g. different OWL pattern that are semantically equivalent but different in their syntax, leading to different RDF triples).