2

This ontology does not quite seem to do what I have in mind:

@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix :         <http://test/> .

:AClass a owl:Class .
:BClass a owl:Class .

# Class 1
:CClass owl:equivalentClass [
  owl:intersectionOf (
    :AClass
    :BClass
  )
] .

Loading this in protege with hermit reasoner I do not see CClass as sub-class of either AClass or BClass. However the following works:

.
.
.

# Class 1
:CClass owl:equivalentClass [
  rdf:type owl:Class ;
  owl:intersectionOf (
    :AClass
    :BClass
  )
] .

Curious on why I need to add rdf:type owl:Class.

  1. Isn't [ ... ] automatically of type owl:Class?
  2. Or being an intersection of two owl:Class make it so?

Thanks

stan_plogic
  • 113
  • 8

1 Answers1

1

In your first snippet, it is clear that the intersection must be an OWL class because it is an intersection of OWL classes. Therefore, :CClass must also be an OWL class. However, this implies some reasoning based on how terms are defined. An OWL parser does not have to apply reasoning and should be directed explicitly to whether a term is an OWL class, an object property, a datatype property, an individual, an ontology, an annotation property, a datatype or some other kind of annotation. In the case of an owl:intersectionOf axiom, it is possible that you are declaring a datatype, rather than an OWL class. So it is only by looking at the content of the list, and finding how the terms inside are declared (viz., :AClass and :BClass), that you can eventually infer that they are all OWL classes, and therefore the intersection is an OWL class, and therefore it is equivalent to an OWL class, and therefore :CClass should or could appear as an OWL class in the editor. OWL tools are free to make this kind of inferences for the sake of robustness, but it is not mandated by the OWL standard.

Edit for clarification: the standard defines a way to map RDF graphs to the abstract syntax of OWL where the constructs that use owl:intersectionOf can be mapped to either a class definition or a datatype definition. The only way the standard recommends to discriminate the two cases is by adding explicitly rdf:type owl:Class or rdf:type rdfs:Datatype (see Tables 12 and 13 of OWL 2 Web Ontology Language Mapping to RDF Graphs). OWL parsers may go beyond what the standard recommends and infer some types based on the context, but they do not have to do it. I know that the OWL API does some such syntactic inferences to avoid crashing on every invalid ontologies.

Antoine Zimmermann
  • 5,314
  • 18
  • 36
  • I did run the "Hermit" reasoner in Protege. So this result was not just based on parser analysis. @ignazio had pointed out that this had to do with mapping RDF to OWL as the problem does not happen if you use the functional syntax. He had put that in a comment and I had asked him to make that into an answer so I can accept it. – stan_plogic May 07 '21 at 01:56
  • Both the answer that that comment was made on and this one are pointing out relevant information. I would accept this answer, as the only thing I can add to it is that in this case the parser is expecting the triples as described here: https://www.w3.org/TR/owl2-mapping-to-rdf/ Various parsers have different levels of adherence to the specs and might, for the sake of convenience of the users, attempt to infer types. But, if possible, it's always better to remove ambiguity - in this case, adding the explicit type triple. – Ignazio May 07 '21 at 19:44
  • The kind of reasoning I'm talking about is not the same as what an OWL reasoner do. What I mean is that, when you have a syntactic token like `:AClass` in an OWL ontology file, the parser has to know whether it is naming a class, a property, an instance, or something else **before** you can even start doing reasoning in the sense of OWL semantics. Determining what role a token plays can be done either by having an explicit declaration (e.g., `:AClass a owl:Class`) or by inference based on the syntactic context. – Antoine Zimmermann May 08 '21 at 15:08
  • Thanks. The additional clarifications really helped. – stan_plogic May 08 '21 at 19:24