簡體   English   中英

如何在Protege中使用類似於范圍的類作為數據屬性

[英]how to use a class like a range for a data properties in Protege

  • 我創建了一個名為kind數據屬性
  • 我希望它的范圍是StateKing 我不知道該怎么做。 實際上,在“屬性斷言視圖”“描述視圖”中 ,當我單擊“添加”圖標(+)時,下一個彈出窗口會出現指定數據類型,如int,Boolean,integer,...
  • 請注意, StateKing是一個枚舉類

    StateKing等價類 {choise,final,fork,initial,join,junction,state}。

謝謝你的建議。

PS:我現在無法添加圖片。

StateKing是一個類,所以如果你想讓一個屬性使用它作為范圍,它需要是一個對象屬性而不是數據屬性。

下面的代碼是使用曼徹斯特語法表示的本體,如果將其保存為.owl,您將能夠使用Protege 4打開它。

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY dc "http://purl.org/dc/elements/1.1/" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>

<rdf:RDF xmlns="http://www.example.org/demo.owl#"
 xml:base="http://www.example.org/demo.owl"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 xmlns:owl="http://www.w3.org/2002/07/owl#"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:xml="http://www.w3.org/XML/1998/namespace">
<owl:Ontology rdf:about="http://www.example.org/demo.owl"/>

<owl:ObjectProperty rdf:about="http://www.example.org/demo.owl#kind">
    <rdfs:range rdf:resource="http://www.example.org/demo.owl#StateKing"/>
</owl:ObjectProperty>

<owl:Class rdf:about="http://www.example.org/demo.owl#StateKing">
    <owl:equivalentClass>
        <owl:Class>
            <owl:oneOf rdf:parseType="Collection">
                <rdf:Description rdf:about="http://www.example.org/demo.owl#join"/>
                <rdf:Description rdf:about="http://www.example.org/demo.owl#state"/>
                <rdf:Description rdf:about="http://www.example.org/demo.owl#choise"/>
                <rdf:Description rdf:about="http://www.example.org/demo.owl#final"/>
                <rdf:Description rdf:about="http://www.example.org/demo.owl#initial"/>
                <rdf:Description rdf:about="http://www.example.org/demo.owl#junction"/>
                <rdf:Description rdf:about="http://www.example.org/demo.owl#fork"/>
            </owl:oneOf>
        </owl:Class>
    </owl:equivalentClass>
</owl:Class>


<owl:Class rdf:about="&owl;Thing"/>

<owl:Thing rdf:about="http://www.example.org/demo.owl#choise">
    <rdf:type rdf:resource="&owl;NamedIndividual"/>
</owl:Thing>

<owl:Thing rdf:about="http://www.example.org/demo.owl#final">
    <rdf:type rdf:resource="&owl;NamedIndividual"/>
</owl:Thing>

<owl:Thing rdf:about="http://www.example.org/demo.owl#fork">
    <rdf:type rdf:resource="&owl;NamedIndividual"/>
</owl:Thing>

<owl:Thing rdf:about="http://www.example.org/demo.owl#initial">
    <rdf:type rdf:resource="&owl;NamedIndividual"/>
</owl:Thing>

<owl:Thing rdf:about="http://www.example.org/demo.owl#join">
    <rdf:type rdf:resource="&owl;NamedIndividual"/>
</owl:Thing>

<owl:Thing rdf:about="http://www.example.org/demo.owl#junction">
    <rdf:type rdf:resource="&owl;NamedIndividual"/>
</owl:Thing>

<owl:Thing rdf:about="http://www.example.org/demo.owl#state">
    <rdf:type rdf:resource="&owl;NamedIndividual"/>
</owl:Thing>
</rdf:RDF>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM