|
From: Chernbumroong, S. <sai...@nt...> - 2015-01-30 17:08:14
|
Dear Sir,
I am currently working on a project using ontology. My application is developed using .NET and I have downloaded your API for the reasoning purpose. However, when I did the inference, the results was not as I expected. It only infers the super class of the object. For example:
The owl file:
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#hasPet -->
<owl:ObjectProperty rdf:about="&untitled-ontology-94;hasPet">
<rdfs:domain rdf:resource="&untitled-ontology-94;Human"/>
<rdfs:range rdf:resource="&untitled-ontology-94;Pet"/>
</owl:ObjectProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#Cat -->
<owl:Class rdf:about="&untitled-ontology-94;Cat">
<rdfs:subClassOf rdf:resource="&untitled-ontology-94;Pet"/>
<owl:disjointWith rdf:resource="&untitled-ontology-94;Dog"/>
</owl:Class>
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#CatPerson -->
<owl:Class rdf:about="&untitled-ontology-94;CatPerson">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="&untitled-ontology-94;Human"/>
<owl:Restriction>
<owl:onProperty rdf:resource="&untitled-ontology-94;hasPet"/>
<owl:someValuesFrom rdf:resource="&untitled-ontology-94;Cat"/>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
<owl:disjointWith rdf:resource="&untitled-ontology-94;DogPerson"/>
</owl:Class>
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#Dog -->
<owl:Class rdf:about="&untitled-ontology-94;Dog">
<rdfs:subClassOf rdf:resource="&untitled-ontology-94;Pet"/>
</owl:Class>
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#DogPerson -->
<owl:Class rdf:about="&untitled-ontology-94;DogPerson">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="&untitled-ontology-94;Human"/>
<owl:Restriction>
<owl:onProperty rdf:resource="&untitled-ontology-94;hasPet"/>
<owl:someValuesFrom rdf:resource="&untitled-ontology-94;Dog"/>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:subClassOf rdf:resource="&untitled-ontology-94;Human"/>
</owl:Class>
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#Human -->
<owl:Class rdf:about="&untitled-ontology-94;Human">
<owl:disjointWith rdf:resource="&untitled-ontology-94;Pet"/>
</owl:Class>
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#Pet -->
<owl:Class rdf:about="&untitled-ontology-94;Pet">
<rdfs:subClassOf rdf:resource="&owl;Thing"/>
</owl:Class>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#ADog -->
<owl:NamedIndividual rdf:about="&untitled-ontology-94;ADog">
<rdf:type rdf:resource="&untitled-ontology-94;Dog"/>
<rdf:type rdf:resource="&untitled-ontology-94;Pet"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/cmp3cherns/ontologies/2014/9/untitled-ontology-94#John -->
<owl:NamedIndividual rdf:about="&untitled-ontology-94;John">
<hasPet rdf:resource="&untitled-ontology-94;ADog"/>
</owl:NamedIndividual>
</rdf:RDF>
My code is as follow:
//First we want to load our data and schema into Graphs
Graph data = new Graph();
FileLoader.Load(data, "ontology.owl");
Graph schema = new Graph();
FileLoader.Load(schema, "ontology.owl");
//Now we ask for things which are cars from our data Graph
IUriNode rdfType = data.CreateUriNode(new Uri(RdfSpecsHelper.RdfType));
//This will result in the triples defining the type for :FordFiesta
//and :AudiA8 being printed
//BUT without inference we don't know that :FerrariEnzo is a car
//So now we'll go ahead and apply inference
RdfsReasoner reasoner2 = new RdfsReasoner();
reasoner2.Initialise(schema);
reasoner2.Apply(data);
foreach (Triple t in data.GetTriplesWithPredicate(rdfType))
{
Console.WriteLine(t.ToString());
}
However, the reasoner cannot discover that John is a dog person. It only found that John is a human. Can you suggest a way to run the reasoner so it knows that John is a dog person? Or is this not possible using dotnetrdf? Thank you for your help
Regards,
Saisakul Chernbumroong
Research fellow
Nottingham Trent University
Clifton Campus
NG11 8NS
DISCLAIMER: This email is intended solely for the addressee. It may contain private and confidential information. If you are not the intended addressee, please take no action based on it nor show a copy to anyone. In this case, please reply to this email to highlight the error. Opinions and information in this email that do not relate to the official business of Nottingham Trent University shall be understood as neither given nor endorsed by the University. Nottingham Trent University has taken steps to ensure that this email and any attachments are virus-free, but we do advise that the recipient should check that the email and its attachments are actually virus free. This is in keeping with good computing practice.
|