0

I have created this ontology which contains two classes Car, Person and the object property hasCar that has Person as domain and Car as range.

I want to classify individuals(Persons) in multiCarOwner and OnlyCar person, here is the ontology that represent this:

<?xml version="1.0"?>


<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!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.owl-ontologies.com/Car.owl#"
 xml:base="http://www.owl-ontologies.com/Car.owl"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:owl="http://www.w3.org/2002/07/owl#"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.owl-ontologies.com/Car.owl"/>



<!-- 
   ///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
 -->




<!-- http://www.owl-ontologies.com/Car.owl#hasCar -->

<owl:ObjectProperty rdf:about="http://www.owl-  ontologies.com/Car.owl#hasCar">
    <rdfs:range rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
    <rdfs:domain rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
</owl:ObjectProperty>



<!-- 
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
 -->




<!-- http://www.owl-ontologies.com/Car.owl#Car -->

<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#Car"/>



<!-- http://www.owl-ontologies.com/Car.owl#CarOwner -->

<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner">
    <owl:equivalentClass>
        <owl:Class>
            <owl:intersectionOf rdf:parseType="Collection">
                <rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Person"/>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
                    <owl:allValuesFrom rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
                </owl:Restriction>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
                    <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
                </owl:Restriction>
            </owl:intersectionOf>
        </owl:Class>
    </owl:equivalentClass>
</owl:Class>



<!-- http://www.owl-ontologies.com/Car.owl#MultiCarOwner -->

<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#MultiCarOwner">
    <owl:equivalentClass>
        <owl:Class>
            <owl:intersectionOf rdf:parseType="Collection">
                <rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner"/>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
                    <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:minCardinality>
                </owl:Restriction>
            </owl:intersectionOf>
        </owl:Class>
    </owl:equivalentClass>
</owl:Class>



<!-- http://www.owl-ontologies.com/Car.owl#OnlyCar -->

<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#OnlyCar">
    <owl:equivalentClass>
        <owl:Class>
            <owl:intersectionOf rdf:parseType="Collection">
                <rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner"/>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
                    <owl:onClass rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
                    <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
                </owl:Restriction>
            </owl:intersectionOf>
        </owl:Class>
    </owl:equivalentClass>
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
            <owl:onClass rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
            <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
        </owl:Restriction>
    </rdfs:subClassOf>
</owl:Class>



<!-- http://www.owl-ontologies.com/Car.owl#Person -->

<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#Person"/>



<!-- 
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
 -->




<!-- http://www.owl-ontologies.com/Car.owl#Alice -->

<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Alice">
    <rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
    <hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_2"/>
    <hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_7"/>
</owl:NamedIndividual>



<!-- http://www.owl-ontologies.com/Car.owl#Bob -->

<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Bob">
    <rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
    <hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_2"/>
</owl:NamedIndividual>



<!-- http://www.owl-ontologies.com/Car.owl#Car_2 -->

<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Car_2">
    <rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
</owl:NamedIndividual>



<!-- http://www.owl-ontologies.com/Car.owl#Car_7 -->

<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Car_7">
    <rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
</owl:NamedIndividual>



<!-- 
///////////////////////////////////////////////////////////////////////////////////////
//
// General axioms
//
///////////////////////////////////////////////////////////////////////////////////////
 -->

<rdf:Description>
    <rdf:type rdf:resource="&owl;AllDifferent"/>
    <owl:distinctMembers rdf:parseType="Collection">
        <rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Car_2"/>
        <rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Car_7"/>
    </owl:distinctMembers>
</rdf:Description>

However, the reasoner does not give me the result that I want when I create individuals, I want that the "OnlyCar" class has as members: "individuals with exactly 1 Car."

The result of the reasoning is partial, because, the tab of individuals in protegé shows the following:

image 1

image 2

The images above show the "Bob" individual as a CarOwner member but i want that "bob" as member of "onlyCar" class.

-I am facing an OWA problem ? -There is a way to accomplish what i want?

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
E.Luque
  • 3
  • 3

1 Answers1

1

The images above show the "Bob" individual as a CarOwner member but i want that "bob" as member of "onlyCar" class. -I am facing an OWA problem ? -There is a way to accomplish what i want?

You've said that bob owns a car, but you haven't told said that bob doesn't own any other car. Without having said that, you can't be sure that he only owns one car. You'll need to add another type assertion to bob, namely:

hasCar only {Car_2}

Then, since you know that he owns Car_2 and you know that he owns only Car_2, you'll be able to infer that bob is an element of

hasCar exactly 1 Car

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Hi Joshua, thanks for the reply, i have some questions. in order to add the assertion "hasCar only {Car_2}", I think it is necessary to create a new class only for bob and another for Alice, it's rigth?, because Alice could have many cars (in the example above Alice was well classified), would be good if individuals belong to a single class (Person), is there any way to accomplish this? – E.Luque Nov 19 '15 at 21:57
  • I'm sorry, I'm not really clear what you addled in that comment. You don't need to create any additional (named) classes to add that type assertion. – Joshua Taylor Nov 19 '15 at 22:25
  • Sorry Joshua. I tried to add the assertion "hasCar only {Car_2}" within the class Person because "bob" is an individual of this class. But, the reasoner give me an inconsistency error, because individuals "Car_2" and "Car_7" are differents and "Alice" owns those cars. – E.Luque Nov 20 '15 at 01:37