Closed MJRinne closed 10 years ago
Property paths expressed with block parenthesis don't work in an INSERT clause.
1) Query (issue8.rq):
PREFIX ep: http://www.ontologydesignpatterns.org/cp/owl/eventprocessing.owl# PREFIX geo: http://www.w3.org/2003/01/geo/wgs84_pos#
INSERT { GRAPH http://next { ?event a ep:EventObject ; geo:Point [ geo:lat ?lat ; geo:long ?long ; ] . } } WHERE { ?event a ep:EventObject ; geo:Point [ geo:lat ?lat ; geo:long ?long ; ] . } ; SELECT * WHERE { GRAPH http://next { ?s ?p ?o } }
2) With data (issue8.ttl):
@prefix ep: http://www.ontologydesignpatterns.org/cp/owl/eventprocessing.owl# . @prefix geo: http://www.w3.org/2003/01/geo/wgs84_pos# .
[] a ep:EventObject ; geo:Point [ geo:lat 60.158776 ; geo:long 24.881490 ; ] .
3) Command line: $ instans -r issue8.rq -t issue8.ttl
This result is produced: s,p,o "_:!-1","http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.ontologydesignpatterns.org/cp/owl/eventprocessing.owl#EventObject"
Also the geo:Point was supposed to be INSERTed. The expected result can be obtained with the query (issue8b.rq):
INSERT { GRAPH http://next { ?event ?p ?o . ?o ?p2 ?o2 } } WHERE { ?event a ep:EventObject ; ?p ?o . OPTIONAL { ?o ?p2 ?o2 } } ; SELECT * WHERE { GRAPH http://next { ?s ?p ?o } }
Which yields the result: s,p,o ":!-0","http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.ontologydesignpatterns.org/cp/owl/eventprocessing.owl#EventObject" ":!-0","http://www.w3.org/2003/01/geo/wgs84_pos#Point","_:!-1" "_:!-1","http://www.w3.org/2003/01/geo/wgs84_pos#long","24.88149" "_:!-1","http://www.w3.org/2003/01/geo/wgs84_pos#lat","60.158775"
Using a select query instead (issue8c.rq):
SELECT * WHERE { ?event a ep:EventObject ; geo:Point [ geo:lat ?lat ; geo:long ?long ; ] }
The result is:
lat,long,event "60.158775","24.88149","_:!-0"
i.e. the matching part inside the WHERE-clause matches the whole geo:Point.
Property paths expressed with block parenthesis don't work in an INSERT clause.
Steps to repeat:
1) Query (issue8.rq):
PREFIX ep: http://www.ontologydesignpatterns.org/cp/owl/eventprocessing.owl# PREFIX geo: http://www.w3.org/2003/01/geo/wgs84_pos#
INSERT { GRAPH http://next { ?event a ep:EventObject ; geo:Point [ geo:lat ?lat ; geo:long ?long ; ] . } } WHERE { ?event a ep:EventObject ; geo:Point [ geo:lat ?lat ; geo:long ?long ; ] . } ; SELECT * WHERE { GRAPH http://next { ?s ?p ?o } }
2) With data (issue8.ttl):
@prefix ep: http://www.ontologydesignpatterns.org/cp/owl/eventprocessing.owl# . @prefix geo: http://www.w3.org/2003/01/geo/wgs84_pos# .
[] a ep:EventObject ; geo:Point [ geo:lat 60.158776 ; geo:long 24.881490 ; ] .
3) Command line: $ instans -r issue8.rq -t issue8.ttl
What happens:
This result is produced: s,p,o "_:!-1","http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.ontologydesignpatterns.org/cp/owl/eventprocessing.owl#EventObject"
What was expected to happen:
Also the geo:Point was supposed to be INSERTed. The expected result can be obtained with the query (issue8b.rq):
INSERT { GRAPH http://next { ?event ?p ?o . ?o ?p2 ?o2 } } WHERE { ?event a ep:EventObject ; ?p ?o . OPTIONAL { ?o ?p2 ?o2 } } ; SELECT * WHERE { GRAPH http://next { ?s ?p ?o } }
Which yields the result: s,p,o ":!-0","http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.ontologydesignpatterns.org/cp/owl/eventprocessing.owl#EventObject" ":!-0","http://www.w3.org/2003/01/geo/wgs84_pos#Point","_:!-1" "_:!-1","http://www.w3.org/2003/01/geo/wgs84_pos#long","24.88149" "_:!-1","http://www.w3.org/2003/01/geo/wgs84_pos#lat","60.158775"
Related:
Using a select query instead (issue8c.rq):
SELECT * WHERE { ?event a ep:EventObject ; geo:Point [ geo:lat ?lat ; geo:long ?long ; ] }
The result is:
lat,long,event "60.158775","24.88149","_:!-0"
i.e. the matching part inside the WHERE-clause matches the whole geo:Point.