Not able to get all subclasses from Protégé query

39 Views Asked by At

I'm trying to get all classes information with a query like this: tire that HasWidth some Width125. What I expect to have is the list of all classes that have or could have the indicated width.

That's my Ontology view: enter image description here

This is my custom Model for a tire called AS7

<owl:Class rdf:about="#AS7">
    <rdfs:label xml:lang="en">Avon AS7</rdfs:label>
      <rdfs:subClassOf rdf:resource="https://spec.edmcouncil.org/auto/ontology/VC/VehicleParts/PneumaticTire"/>
   <rdfs:subClassOf>
      <owl:Restriction>
          <owl:onProperty rdf:resource="#HasWidth"/>
          <owl:someValuesFrom rdf:resource="#Width"/>
      </owl:Restriction>
    </rdfs:subClassOf>
    <rdfs:subClassOf>
</owl:Class>

That is my Width class

<owl:Class rdf:about="#Width">
    <rdfs:label xml:lang="en">Width</rdfs:label>
    <rdfs:subClassOf rdf:resource="https://spec.edmcouncil.org/auto/ontology/VC/VehicleParts/Tire"/>
</owl:Class>

And here an example of subclass

<owl:Class rdf:about="#Width125">
    <rdfs:subClassOf rdf:resource="#Width"/>
    <rdfs:comment>Width 125.</rdfs:comment>
    <rdfs:isDefinedBy rdf:resource=""/>
    <rdfs:label>Width 125</rdfs:label>
</owl:Class>

Is my restriction/DL quey incorrect or may I miss something?

1

There are 1 best solutions below

0
Dallas On BEST ANSWER

Solve it. The issue was on my restriction that needs to be a collections with the property intersectionOf. The code looks like this:

<owl:Class rdf:about="#AllWidth">
<rdfs:subClassOf rdf:resource="#Width"/>
<owl:equivalentClass>
    <owl:Class>
        <owl:intersectionOf rdf:parseType="Collection">
            <owl:Restriction>
                <owl:onProperty rdf:resource="#HasWidth"/>
                <owl:someValuesFrom rdf:resource="#Width125"/>
            </owl:Restriction>
           ...
        </owl:intersectionOf>
    </owl:Class>
</owl:equivalentClass>
</owl:Class>

And in the property

<rdfs:subClassOf>
    <owl:Restriction>
        <owl:onProperty rdf:resource="#HasWidth"/>
        <owl:allValuesFrom rdf:resource="#AllWidth"/>
    </owl:Restriction>
</rdfs:subClassOf>