rdfowlontologysemantic-webrdfs

Reuse existing classes in an ontology


I design my own ontology and I reuse items from other ontologies. Is it good or bad practice to subclass an item from another ontology under an existing one? Or should I define my own subclass?

Classes in my ontology

<http://schema.org/Place> a owl:Class .

<http://OtherOntology/Area> a owl:Class;
  rdfs:subClassOf <http://schema.org/Place> .

<http://MyOntology/TinyPlace> a owl:Class;
  rdfs:subClassOf <http://schema.org/Place> .

Solution

  • RDF data in general is about "facts" asserted by a particular graph, including facts about a particular ontology. At this level, it doesn't matter which ontology a vocabulary item is part of, since the URI is not relevant and all ontologies stay in "your" graph.

    This is different however when your ontology becomes a part of the linked data network. There are no particular guidelines as for what you should be publishing, but I think a good rule of thumb is "don't speak for others", i.e. don't publish facts about entities in other datasets in the same place as facts about entities in your dataset (concretely, at least one node in a triple should be "yours"). This pertains to this part:

    <http://OtherOntology/Area> a owl:Class;
      rdfs:subClassOf <http://schema.org/Place> .
    

    You are stating something about a foreign class, but what if a user or importer of your ontology has a different idea about it? There are vocabularies which don't have a unique OWL ontology, so there is a potential for contradictions in some situations. It's probably fine here, but you can never be sure.

    It is better to use owl:imports to import http://OtherOntology/ if possible, assuming it is published using OWL. If not, you may publish the relevant part yourself separately, and import it externally, or refer to that document using rdfs:isDefinedBy.

    You are however encouraged to use existing classes for maximum interoperability, so using http://schema.org/Place and http://OtherOntology/Area is perfectly fine.