How could I use owl:sameas to link between two ontologies?
If I have Ontology A
:c rdf:type owl:Class .
and Ontology B
:d rdf:type owl:Class .
I want to link the two ontologies with the shared concepts (:c and :d), I've read about owl:sameas but that is used inside only one ontology between instances of similar classes within the ontology.
I would like to link between class :c and class :d of the two ontologies, what is the solution for that?
I've read about owl:sameas but that is used inside only one ontology
between instances of similar classes within the ontology.
owl:sameAs is, as you note, for indicating that one individual is the same as another individual. If you want to say that two classes are equivalent, then you should use an equivalent class axiom of the form C owl:equivalentClass D.
When you're writing an ontology A and you define a class C, but want to indicate that it's equivalent to some class D that is defined in ontology B, you have two options:
- You can declare a class in your ontology with the same IRI as D's. That is, you redeclare class D in your ontology, and then just say that C is equivalent to D. If anybody imports both your ontology and the other ontology, they'll have the axiom that states that the two classes are equivalent.
- You can import the other ontology, so that you import the declaration of class D. Then you just add the equivalent class axiom to your ontology.
Of these, the second is the better option in my opinion, most of the time. If you're going to equate your class to someone else's, then any reasoning performed over your ontology should probably take into account the axioms asserted in the other ontology, so you should import it. If you're not planning on doing any reasoning at all, then the import is essentially ignored, but you still follow the good practice of letting others know that there are some other definitions out there that are relevant.
The only case that I think the import would not be a good idea is if the other ontology is inconsistent, or if it's not an OWL ontology but, perhaps, an RDF vocabulary, or something like that. In those cases, the original semantics of the class might not be exactly the same as yours, and it would be better to avoid the import (although, you might want to avoid the equivalent class axiom, too, if the classes aren't actually equivalent).