Use SPARQL property path on DBpedia -
i'd find out if property paths exist between 2 entities on dbpedia. sample query tried on snorql
:
select * { :braveheart (:|!:)* :mel_gibson } limit 100
the queries runs memory error:
virtuoso 42000 error tn...: exceeded 1000000000 bytes in transitive temp memory. use t_distinct, t_max or more t_max_memory options limit search or increase pool sparql query: define sql:big-data-const 0 #output-format:application/sparql-results+json define input:default-graph-uri prefix owl: prefix xsd: prefix rdfs: prefix rdf: prefix foaf: prefix dc: prefix : prefix dbpedia2: prefix dbpedia: prefix skos: select * { :braveheart (:|!:)* :mel_gibson } limit 100
i suspect someone's going suggest setting local dbpedia mirror. if that's case, i'd love detailed steps on how so.
i think query bit wrong you're trying answer... there no variables in select *
can't project out (i'd consider bug compile this), let me rephrase query to
ask { dbr:braveheart (<>|!<>)+ dbr:mel_gibson }
sadly query errs same problem described.
while agree, complicated should executed against local endpoints, above query isn't complicated @ all, considering there several direct edges between 2 nodes:
select * { dbr:braveheart ?p dbr:mel_gibson }
i consider bug in virtuoso's query planner , reported it: https://github.com/openlink/virtuoso-opensource/issues/641
having said that, i'd point out in real cases you're interested in paths don't point forward. direction of edges depends on modelling. consider using queries these instead:
ask { dbr:braveheart ((<>|!<>)|^(<>|!<>))+ dbr:mel_gibson }
the expression says follow edge in direction or against (^
) @ least 1 step. (yes, wonder why property paths didn't short syntax arbitrary edges ;) )
Comments
Post a Comment