0

How to query the path between two IRI within the same sparql endpoint,Can I control the length and direction of the path.For example, I have some triples,input IRI_A and IRI_B,Can all the paths between IRI_A and IRI_B be detected? now i know that sparql can use this statement,However, the length and direction of the path cannot be controlled

SELECT ?s ?p ?o
   WHERE {
   GRAPH ?g {
       BIND ( <http://localhost/XXX/IRI_A> AS ?start ) .
       BIND ( <http://localhost/XXX/IRI_B> AS ?end ) .
       ?start (<>|!<>)* ?s .
       ?s ?p ?o .
       ?o (<>|!<>)* ?end .
   }
}

I want to find all the paths between two IRIs

gaos
  • 1
  • 1
    I told you already that SPARQL is the wrong query language for graph traversal and path retrieval (modulo some triple stores which provide graph extension, but those are not standard SPARQL) - for length of paths: https://stackoverflow.com/questions/31048247/calculate-length-of-path-betwen-nodes-with-unknown-edges - also getting paths: https://stackoverflow.com/questions/18024413/finding-all-steps-in-property-path – UninformedUser Oct 26 '22 at 03:26

0 Answers0