On 8/16/16 3:08 PM, Eng.Bassam wrote: > > > Thanks Kingsley, > But the query1 doesn't make an inference > DEFINE input:inference 'urn:owl:inference:rules:tests' > PREFIX rel: <http://purl.org/vocab/relationship/> > > SELECT * > FROM <urn:royals:demo> > > WHERE > { > <http://dbpedia.org/resource/Elizabeth_Bowes-Lyon> > rel:ancestorOf > ?o > } > > > > I think the query must return : > <http://dbpedia.org/resource/Elizabeth_II_of_the_United_Kingdom> > <http://dbpedia.org/resource/Elizabeth_II_of_the_United_Kingdom> > <http://dbpedia.org/resource/Charles,_Prince_of_Wales> > <http://dbpedia.org/resource/Prince_William_of_Wales> > but it returns only: > <http://dbpedia.org/resource/Elizabeth_II_of_the_United_Kingdom> > > Why an inference not working properly?? > > > > On Tue, Aug 16, 2016 at 9:01 PM, Kingsley Idehen > <kide...@openlinksw.com <mailto:kide...@openlinksw.com>> wrote: > > On 8/16/16 9:16 AM, Eng.Bassam wrote: >> Hi >> >> Suppose I have an ontology for fruits: >> Bana is Fruit. >> Apple is Fruit. >> >> Also suppose I have other dataset that contains: >> >> Bassam eat Apple. >> Husam eat Banana. >> >> Can I do following question (SPARQL query) using Virtuoso, Who >> eat Fruits? >> the answer must be Bassam and Husam, because there is an >> inference (Banana and Apple are fruits) >> >> Thanks >> >> -- >> ----------------------------------- >> > Eng.Bassam Najeeb. >> >Software Engineer. > > Please read about reasoning and inference pragma use in the > example at [1]. > > Note: my demos are live and sometimes the underlying data might > change which can affect expected results, but in this case the > post will show you how to map your RDF statements to an Inference > Rule which then apply in-built reasoning on RDF Schema and most > OWL relationship type semantics. > > For your example, I sense you are looking for Custom Inference > Rules. If so, then you should look at [2] which demonstrates this > feature. That said, the feature is part of Virtuoso 8.0 (which are > are about to release, but in Commercial Edition mode only for this > feature). > > Links: > > [1] > > https://medium.com/virtuoso-blog/using-british-royal-family-data-snippets-to-demonstrate-sparql-query-language-based-reasoning-56626a152419 > > <https://medium.com/virtuoso-blog/using-british-royal-family-data-snippets-to-demonstrate-sparql-query-language-based-reasoning-56626a152419> > [2] > > https://www.linkedin.com/pulse/reasoning-inference-using-british-royal-family-part-idehen > > <https://www.linkedin.com/pulse/reasoning-inference-using-british-royal-family-part-idehen> > > Kingsley >
Yes, you are correct in your observation. Issue is that on my live servers changes can sometimes happen e.g., rules being lost or location of Relationship Ontology Data (the case here). You can see the live rules via [1]. I've fixed the problem as per [2] Here's what I applied to URIBurner with regards to the problem you discovered: SPARQL CLEAR GRAPH <http://purl.org/vocab/relationship/> ; SPARQL LOAD <http://vocab.org/relationship/rel-vocab-20100607.rdf> INTO <http://purl.org/vocab/relationship/> ; SPARQL SELECT * FROM <http://purl.org/vocab/relationship/> WHERE { ?s ?p ?o }; rdfs_rule_set ( 'urn:relationships:ontology:inference:rules' , 'http://purl.org/vocab/relationship/' ) ; Thanks for your feedback as this problem would have been lingering out there forever :( Links: [1] http://linkeddata.uriburner.com/sparql/rdfinf.vsp [2] http://linkeddata.uriburner.com/sparql?default-graph-uri=&query=SELECT+*%0D%0AFROM+%3Curn%3Aroyals%3Ademo%3E%0D%0AWHERE%0D%0A%0D%0A++++%7B%0D%0A++++++%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FElizabeth_Bowes-Lyon%3E%0D%0A++++++rel%3AancestorOf%2B+%3Fo%0D%0A%0D%0A++++%7D&should-sponge=&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000000 -- Correct solution based on Inference Context being enabled. -- Regards, Kingsley Idehen Founder & CEO OpenLink Software (Home Page: http://www.openlinksw.com) Medium Blog: https://medium.com/@kidehen Blogspot Blog: http://kidehen.blogspot.com Twitter Profile: https://twitter.com/kidehen Google+ Profile: https://plus.google.com/+KingsleyIdehen/about LinkedIn Profile: http://www.linkedin.com/in/kidehen Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this
smime.p7s
Description: S/MIME Cryptographic Signature
------------------------------------------------------------------------------
_______________________________________________ Virtuoso-users mailing list Virtuoso-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/virtuoso-users