简体   繁体   中英

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

  • I create a data properties named kind .
  • I want it range to be StateKing . I don't know how to do. In fact, in the "Property assertions view" , "Description view" , when I click on to the 'Add' icon (+) next Ranges pop up appear with a specify datatypes like int, Boolean, integer, ...
  • Note that StateKing is an enumerate class .

    StateKing : Equivalent classes {choise , final , fork , initial , join , junction , state}.

Thank you for your advices.

PS: I can't add image now.

StateKing is a class, so if you want to have a property using it as range, it need to be an object property and not a data property.

The code below is your ontology represented using the Manchester syntax, if you save it as .owl you will be able to open it with 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM