Trying to execute a query using rdf4j console against a sparql endpoint to find the path between 2 nodes using property wildcards but no luck. The first query gives an error as
Malformed query: Not a valid (absolute) IRI:
The second query crashes the console. Should I try to use the query using a different way to query the endpoint as this maybe an rdf4j issue or is the query itself wrong?
PREFIX xy: <http://mainuri/>
select
*
where
{
<http://uriOfInstanceOfData> ((<>|!<>)|^(<>|!<>))* ?x .
?x ?p ?o .
?o ((<>|!<>)|^(<>|!<>))* <http://uriOfInstanceOfData>.
}
AND
PREFIX xy: <http://mainuri/>
select
*
where
{
<http://uriOfInstanceOfData> (xy:|!xy:)* ?x .
?x ?p ?o .
?o (xy:|!xy:)* <http://uriOfInstanceOfData>.
}
create sparql
, or something else?), and what the exact query (including the actual IRIs for the nodes you're querying for) are? Just so I can reproduce. – HambySELECT * WHERE{ wd:Q11571 (wdt:|!wdt:)* ?x . ?x ?p ?o . ?o (wdt:|!wdt:)* wd:Q45. }
Could you point to some resources for doing path traversals with rdf4j api? Thanks – Ferrick