How to infer individual with more than 2 property in owl


I have an ontology with Person and Animal_Lover classes. People are Animal_Lover if they have more than 2 pet. How can I do this in my ontology?

<?xml version="1.0"?> <rdf:RDF xmlns="http://www.example.com/test" xml:base="http://www.example.com/test" xmlns:test="http://www.example.com/test#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <owl:Ontology rdf:about="http://www.example.com/test"/> <owl:ObjectProperty rdf:about="http://www.example.com/test#hasPet"/> <owl:Class rdf:about="http://www.example.com/test#Animal_Lover"> <owl:equivalentClass> <owl:Restriction> <owl:onProperty rdf:resource="http://www.example.com/test#hasOwner"/> <owl:minQualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">2</owl:minQualifiedCardinality> <owl:onClass rdf:resource="http://www.example.com/test#Mammal"/> </owl:Restriction> </owl:equivalentClass> <rdfs:subClassOf rdf:resource="http://www.example.com/test#Person"/> </owl:Class> <!-- http://www.example.com/test#Mammal --> <owl:Class rdf:about="http://www.example.com/test#Mammal"/> <!-- http://www.example.com/test#Person --> <owl:Class rdf:about="http://www.example.com/test#Person"> <rdfs:subClassOf rdf:resource="http://www.example.com/test#Mammal"/> </owl:Class> <!-- http://www.example.com/test#Smith --> <owl:NamedIndividual rdf:about="http://www.example.com/test#Smith"> <rdf:type rdf:resource="http://www.example.com/test#Person"/> <test:hasPet rdf:resource="http://www.example.com/test#Lulu"/> <test:hasPet rdf:resource="http://www.example.com/test#Nala"/> <test:hasPet rdf:resource="http://www.example.com/test#Tank"/> </owl:NamedIndividual> </rdf:RDF>

I want Smith to be inferred and become Animal_Lover. But This code does not work in owl( or GraphDB). What is the problem?

Thanks for your help.


There are three problems:

<ol><li>First, it is quite possible that "Nala" and "Tank" are two nicknames of the pet Lulu. So perhaps Smith only has one pet, whose name is Lulu and that people like to call Nala, or Tank, for some reasons.</li> <li>Second, the inference can only happen if you use the hasOnwer property. You are using hasPet instead.</li> <li>Third, you did not say that Lula, Nala, and Tank are mammals. If they are fishes, then you can't infer that Smith is an animal lover (!)</li> </ol>


  • Jena Sparql Error java.lang.Integer
  • Show generated SQL in toplink in eclipse
  • Select an attribute with Xpath in a XML with namespace using Powershell
  • Spring custom user details service null pointer exception
  • How to retrieve elements of OWL enumerated datatype expression?
  • SessionInformation expiration doesn't lead to user log out from system
  • Is there a better method than to reuse a complicated table in DocBook?
  • Filtering SPARQL results by day and month
  • How to call BeanFactoryPostProcessor.postProcessBeanFactory method when use Spring with XML configur
  • C++ Coin flip program error
  • string.IsNullOrEmpty() Doesn't Seem to Work on a String within a Class within a Class
  • Sending Content-Type application/x-www-form-urlencoded WSO2 ESB
  • Separate ID and Class for JS and CSS
  • Feature detection of foreignObject in SVG
  • XSD with multi occurrences unordered
  • SPARQL date range
  • ZipList with Scalaz
  • Alamofire and Reachability.swift not working on xCode8-beta5
  • Sesame : how to remove the inference during queries?
  • WPF Template Binding in ToggleButton UserControl
  • CERN ROOT exporting data to plain text
  • How to convert SOAP response with xsi values to json in WSO2esb
  • Question about instantiating object
  • Jetty 9 HashLoginService
  • Play WS (2.2.1): post/put large request
  • Email verification using google app script and google forms
  • Cancel a live stream “fast motion” catch-up in Flash
  • Read a local file using javascript
  • ImageMagick, replace semi-transparent white with opaque white
  • Cannot connect to cassandra from Spark
  • Cross-Platform Protobuf Serialization
  • Deserializing XML into class C#
  • Alternatives to the OPTIONAL fallback SPARQL pattern?
  • Is there a mandatory requirement to switch app.yaml?
  • Java static initializers and reflection
  • unknown Exception android
  • Checking variable from a different class in C#
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • Unable to use reactive element in my shiny app