On 10/9/24 2:57 PM, Kingsley Idehen via Wikidata wrote:
On 10/9/24 2:41 PM, Kingsley Idehen via Wikidata wrote:Hi Peter, On 10/9/24 2:26 PM, Peter F. Patel-Schneider wrote: I use the QLever Wikidata SPARQL service at https://qlever.cs.uni-freiburg.de/wikidata/ The Virtuoso service I use is at https://wikidata.demo.openlinksw.com/sparql I believe that both of these are the standard endpoints and are the same that you used. peter For this kind of transitive closure Virtuoso needs a starting point.https://wikidata.demo.openlinksw.com/sparql?default-graph-uri=http%3A%2F%2Fwww.wikidata.org%2F&query=SELECT+%3Fsub+%3Fsuper+WHERE+%7B%0D%0A++%3Fsub+wdt%3AP279%2B+%3Fsuper+.%0D%0A+++FILTER+%28%3Fsub+%3D+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ391414%3E%29%0D%0A%7D+%0D%0A&format=text%2Fhtml&timeout=30000&signal_void=on <https://wikidata.demo.openlinksw.com/sparql?default-graph-uri=http%3A%2F%2Fwww.wikidata.org%2F&query=SELECT+%3Fsub+%3Fsuper+WHERE+%7B%0D%0A++%3Fsub+wdt%3AP279%2B+%3Fsuper+.%0D%0A+++FILTER+%28%3Fsub+%3D+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ391414%3E%29%0D%0A%7D+%0D%0A&format=text%2Fhtml&timeout=30000&signal_void=on>Can you not share a similar SPARQL Protocol link for QLever? KingsleyAnother variant.https://wikidata.demo.openlinksw.com/sparql?default-graph-uri=http%3A%2F%2Fwww.wikidata.org%2F&query=SELECT+%3Fsub+%3Fsuper+WHERE+%7B%0D%0A++%3Fsub+wdt%3AP279%2B+%3Fsuper+.%0D%0A+FILTER%28+%3Fsuper+%3D+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ385378%3E%29%0D%0A%7D+&format=text%2Fx-html%2Btr&timeout=30000&signal_void=on <https://wikidata.demo.openlinksw.com/sparql?default-graph-uri=http%3A%2F%2Fwww.wikidata.org%2F&query=SELECT+%3Fsub+%3Fsuper+WHERE+%7B%0D%0A++%3Fsub+wdt%3AP279%2B+%3Fsuper+.%0D%0A+FILTER%28+%3Fsuper+%3D+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ385378%3E%29%0D%0A%7D+&format=text%2Fx-html%2Btr&timeout=30000&signal_void=on>Query text.|SELECT ?sub ?super WHERE { ?sub wdt:P279+ ?super . FILTER( ?super = <http://www.wikidata.org/entity/Q385378>) } |
Okay, here’s a QLever query that handles the transitive closure with a constant designating a start point.
https://qlever.cs.uni-freiburg.de/wikidata/?query=PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0ASELECT+%3Fsub+%3Fsuper+WHERE+%7B%0A++%3Fsub+wdt%3AP279%2B+%3Fsuper+.%0A+%23+FILTER%28+%3Fsuper+%3D+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ385378%3E%29%0A%7D+We’ll take a look at how that’s being pull off since the following fails, stating:
“Error processing queryTried to allocate 30 GB, but only 9.9 GB were available. Clear the cache or allow more memory for QLever during startup”
https://qlever.cs.uni-freiburg.de/wikidata/?query=SELECT+%28SAMPLE%28%3Fs%29+as+%3Fsample%29+%28count%28%2A%29+as+%3Fcount%29+%3Fo+%0AWHERE+%7B%3Fs+a+%3Fo%7D+%0AGROUP+BY+%3Fo+%0AORDER+BY+DESC+%28%3Fcount%29+%0ALIMIT+20+|SELECT (SAMPLE(?s) as ?sample) (count(*) as ?count) ?o WHERE {?s a ?o} GROUP BY ?o ORDER BY DESC (?count) LIMIT 20 |
-- Regards, Kingsley Idehen Founder & CEO OpenLink Software Home Page:http://www.openlinksw.com Community Support:https://community.openlinksw.com Weblogs (Blogs): Company Blog:https://medium.com/openlink-software-blog Virtuoso Blog:https://medium.com/virtuoso-blog Data Access Drivers Blog:https://medium.com/openlink-odbc-jdbc-ado-net-data-access-drivers Personal Weblogs (Blogs): Medium Blog:https://medium.com/@kidehen Legacy Blogs:http://www.openlinksw.com/blog/~kidehen/ http://kidehen.blogspot.com Profile Pages: Pinterest:https://www.pinterest.com/kidehen/ Quora:https://www.quora.com/profile/Kingsley-Uyi-Idehen Twitter:https://twitter.com/kidehen Google+:https://plus.google.com/+KingsleyIdehen/about LinkedIn:http://www.linkedin.com/in/kidehen Web Identities (WebID): Personal:http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i :http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this
_______________________________________________ Wikidata mailing list -- [email protected] Public archives at https://lists.wikimedia.org/hyperkitty/list/[email protected]/message/KHVF7IKW4C4MHMKCSJMGSQYY7QQ54KKQ/ To unsubscribe send an email to [email protected]
