ontodev / rdftab.rs

RDF Tables in Rust
BSD 3-Clause "New" or "Revised" License
16 stars 3 forks source link

Additional notes on stanzas to add to README, edge cases for symmetric axioms and GCIs #10

Closed cmungall closed 3 years ago

cmungall commented 3 years ago

I suggest adding something like this to the end of the README

### Stanza edge cases. 

Note that OWL does not prioritize the directionality of some symmetric axiom types - for example, when you have a disjointness axiom or equivalence axiom connecting two named classes. In this case, the stanza is chosen arbitrarily.

E.g. in an ontology that has `A disjointWith B` we get:

ex:B|ex:B|rdfs:label||B||
ex:B|ex:B|owl:disjointWith|ex:a|||
ex:B|ex:B|rdf:type|owl:Class|||
ex:a|ex:a|rdfs:label||A||
ex:a|ex:a|rdf:type|owl:Class|||

This means that the convenience query shown above does not reliably fetch all axioms for a class - e.g. in the above querying on A would not get the disjointness axiom

Additionally, the stanza name may not be meaningful for GCIs. For example, given an axiom:

develops-from some (part-of some B) DisjointWith develops-from some (part-of some A)

i.e.

   <owl:Restriction>
        <owl:onProperty rdf:resource="http://example.com/develops-from"/>
        <owl:someValuesFrom>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://example.com/part-of"/>
                <owl:someValuesFrom rdf:resource="http://example.com/B"/>
            </owl:Restriction>
        </owl:someValuesFrom>
        <owl:disjointWith>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://example.com/develops-from"/>
                <owl:someValuesFrom>
                    <owl:Restriction>
                        <owl:onProperty rdf:resource="http://example.com/part-of"/>
                        <owl:someValuesFrom rdf:resource="http://example.com/a"/>
                    </owl:Restriction>
                </owl:someValuesFrom>
            </owl:Restriction>
        </owl:disjointWith>
    </owl:Restriction>

we get:

owl:disjointWith|_:riog00000011|owl:disjointWith|_:riog00000013|||
owl:disjointWith|_:riog00000013|owl:someValuesFrom|_:riog00000014|||
owl:disjointWith|_:riog00000014|owl:someValuesFrom|ex:a|||
owl:disjointWith|_:riog00000014|owl:onProperty|ex:part-of|||
owl:disjointWith|_:riog00000014|rdf:type|owl:Restriction|||
owl:disjointWith|_:riog00000013|owl:onProperty|ex:develops-from|||
owl:disjointWith|_:riog00000013|rdf:type|owl:Restriction|||
owl:disjointWith|_:riog00000011|owl:someValuesFrom|_:riog00000012|||
owl:disjointWith|_:riog00000012|owl:someValuesFrom|ex:B|||
owl:disjointWith|_:riog00000012|owl:onProperty|ex:part-of|||
owl:disjointWith|_:riog00000012|rdf:type|owl:Restriction|||
owl:disjointWith|_:riog00000011|owl:onProperty|ex:develops-from|||
owl:disjointWith|_:riog00000011|rdf:type|owl:Restriction|||

in this case, to fetch all axioms for class ex:a or ex:B we need to iteratively query to walk up the graph
jamesaoverton commented 3 years ago

Good edge case. Thanks!

jamesaoverton commented 3 years ago

I tried this locally and got the same output. I'm surprised that the stanza is being set to "owl:disjointWith". It should be "_:riog00000011" because that's the top-level node. So I think there's a bug.

But even so, your point stands about the stanza not capturing this.