无法从Protégé查询中获取所有子类。

huangapple go评论55阅读模式
英文:

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

问题

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:
无法从Protégé查询中获取所有子类。

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 query incorrect or may I miss something?

英文:

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:
无法从Protégé查询中获取所有子类。

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

得分: 0

解决它。问题出在我需要一个具有属性 intersectionOf 的集合上。
代码看起来像这样:

<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>

而在属性中

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

英文:

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

&lt;owl:Class rdf:about=&quot;#AllWidth&quot;&gt;
&lt;rdfs:subClassOf rdf:resource=&quot;#Width&quot;/&gt;
&lt;owl:equivalentClass&gt;
    &lt;owl:Class&gt;
        &lt;owl:intersectionOf rdf:parseType=&quot;Collection&quot;&gt;
            &lt;owl:Restriction&gt;
                &lt;owl:onProperty rdf:resource=&quot;#HasWidth&quot;/&gt;
                &lt;owl:someValuesFrom rdf:resource=&quot;#Width125&quot;/&gt;
            &lt;/owl:Restriction&gt;
           ...
        &lt;/owl:intersectionOf&gt;
    &lt;/owl:Class&gt;
&lt;/owl:equivalentClass&gt;
&lt;/owl:Class&gt;

And in the property

&lt;rdfs:subClassOf&gt;
    &lt;owl:Restriction&gt;
        &lt;owl:onProperty rdf:resource=&quot;#HasWidth&quot;/&gt;
        &lt;owl:allValuesFrom rdf:resource=&quot;#AllWidth&quot;/&gt;
    &lt;/owl:Restriction&gt;
&lt;/rdfs:subClassOf&gt;

huangapple
  • 本文由 发表于 2023年6月15日 02:48:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76476696.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定