From: Rob V. <rv...@do...> - 2015-02-25 11:15:39
|
Hi If the query has zero results then it does not match the data. Try breaking your query down into simpler queries to see which parts do and don't match data in order to figure out why your query doesn't work See the following documentation for some more tips on this: https://bitbucket.org/dotnetrdf/dotnetrdf/wiki/HowTo/Debug%20SPARQL%20Querie s.wiki#!debugging-sparql-queries Rob From: "Chernbumroong, Saisakul" <sai...@nt...> Date: Monday, 9 February 2015 12:41 To: Rob Vesse <rv...@do...> Subject: RE: [dotNetRDF-Support] Help with reasoner in dornetrdf > Dear Rob, > > Thank you for your help. > > I would like to ask another question. I am trying to retrieve all property > restriction of a particular class using SPARQL. However, I couldn’t get any > results (result=0). Could you please give suggestion? > > My query: > > SELECT ?p > WHERE { > p:DogPerson rdfs:subClassOf ?p. > ?p a owl:Restriction. > } > > I also tried: > > SELECT ?z > WHERE { > p:DogPerson (rdfs:subClassOf)/owl:onProperty ?z. > } > > > > > Regards, > > Saisakul Chernbumroong > > > Research fellow > > Nottingham Trent University > Clifton Campus > NG11 8NS > > > From: Rob Vesse [mailto:rv...@do...] > Sent: 30 January 2015 17:46 > To: dotNetRDF User Help and Support > Cc: Chernbumroong, Saisakul > Subject: Re: [dotNetRDF-Support] Help with reasoner in dornetrdf > > > Hi > > > > The reasoner you are using only does RDFS reasoning so it is no surprise that > it doesn't not infer something that requires OWL support > > > > dotNetRDF has no native OWL reasoning support, use a 3rd party store like > Stardog > (https://bitbucket.org/dotnetrdf/dotnetrdf/wiki/UserGuide/Storage/Stardog) > which does support OWL reasoning if you need OWL reasoning. There is a free > community edition that should be suitable for use if you are a student > > > > Rob > > > > p.s. this is a subscription based list, I have moderated your email through > this time and CC'd you on the reply but please subscribe > (https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support) if you wish > to continue participating in discussions > > > > From: "Chernbumroong, Saisakul" <sai...@nt...> > Reply-To: dotNetRDF User Help and Support > <dot...@li...> > Date: Friday, 30 January 2015 08:33 > To: "dot...@li..." > <dot...@li...> > Subject: [dotNetRDF-Support] Help with reasoner in dornetrdf > > >> >> 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 = newGraph(); >> >> FileLoader.Load(data, "ontology.owl"); >> >> Graph schema = newGraph(); >> >> FileLoader.Load(schema, "ontology.owl"); >> >> >> >> //Now we ask for things which are cars from our data Graph >> >> IUriNode rdfType = >> data.CreateUriNode(newUri(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 = newRdfsReasoner(); >> >> 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. >> ----------------------------------------------------------------------------- >> - Dive into the World of Parallel Programming. The Go Parallel Website, >> sponsored by Intel and developed in partnership with Slashdot Media, is your >> hub for all things parallel software development, from weekly thought >> leadership blogs to news, videos, case studies, tutorials and more. Take a >> look and join the conversation now. >> http://goparallel.sourceforge.net/___________________________________________ >> ____ dotNetRDF-Support mailing list >> dot...@li...https://lists.sourceforge.net/lists/li >> stinfo/dotnetrdf-support > 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. |