Here is a simpler example, also based on Joshua Taylor's creative solution: https://docs.google.com/document/d/10l9QuAwtiFvP_CPJEaLYzHkXQQrv7qJHNItODCZjU40/edit#heading=h.59igirx1f2fn
It is written as a SELECT query, but could easily be adapted to be a CONSTRUCT query.
David Booth On 07/07/2015 10:22 AM, Rob Vesse wrote:
SPARQL 1.1 only requires an engine to return that there is a path between the two nodes and it does not require (nor provide a mechanism) for an engine to return details of that path Thus you can't reconstruct the matched path because the information simply does not exist in the engine at the point where it evaluates the CONSTRUCT template. There are some creative workarounds such as http://stackoverflow.com/a/18032019/107591 which let you get information about intermediate nodes in the path but these would require custom post-processing to reconstruct the paths so likely can't be used in a CONSTRUCT template either Rob From: Hanane Ouksili <[email protected] <mailto:[email protected]>> Date: Tuesday, 7 July 2015 12:21 To: <[email protected] <mailto:[email protected]>> Subject: Re: Resent-From: <[email protected] <mailto:[email protected]>> Resent-Date: Tue, 07 Jul 2015 14:12:01 +0000 Dear all, I have the following question: In the previous version of SPRQL I was using the CONSTRUCT clause to extract the graph part of a KB. This feature does not seam to work in the SPARQL 1.1. when i use the Path Language For example, CONSTRUCT { ?x (^rdfs:subClassOf)*/^rdf:type ?y } WHERE { ?x (^rdfs:subClassOf)*/^rdf:type ?y } I want, by this query to extract the path between ?x and ?y when it is egale to (^rdfs:subClassOf)*/^rdf:type. This query work with the SELECT clause but no with the CONSTRUCT clause Can you please tell me if I do something wrong or if there is an other solution to do that in SPARQL 1.1? Thank you in advance, On Tue, Jul 7, 2015 at 1:14 PM, Hanane Ouksili <[email protected] <mailto:[email protected]>> wrote: Dear all, I have the following question: In the previous version of SPRQL I was using the CONSTRUCT clause to extract the graph part of a KB. This feature does not seam to work in the SPARQL 1.1. when i use the Path Language Can you please tell me if I do something wrong or if there is -- / Hanane OUKSILI Doctorante - Laboratoire PRiSM Université de Versailles-St-Quentin-en-Yvelines - EDF - R&D Département STEP Chatou / -- / Hanane OUKSILI Doctorante - Laboratoire PRiSM Université de Versailles-St-Quentin-en-Yvelines - EDF - R&D Département STEP Chatou [email protected] <mailto:[email protected]> tél 00336 49 69 43 03 /
