[
https://issues.apache.org/jira/browse/JENA-1092?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Osma Suominen updated JENA-1092:
--------------------------------
Description:
I found a possible problem with WITH statements in SPARQL Update queries. They
do not seem to affect the INSERT clause in the expected way. The behaviour
appears to have changed since Jena 3.0.0.
To reproduce:
1. Start Fuseki 1.3.1:
./fuseki-server --update --mem /ds
2. Create a triple in the <http://example.com/> graph:
{noformat}
PREFIX ex: <http://example.com/>
INSERT DATA { GRAPH ex: { ex:s ex:p ex:o }}
{noformat}
3. Run an update query using WITH:
PREFIX ex: <http://example.com/>
WITH ex:
INSERT { ex:s2 ex:p2 ex:o2 }
WHERE { ?s ?p ?o }
4. Check what you end up in the <http://example.com/> graph:
PREFIX ex: <http://example.com/>
SELECT * WHERE { GRAPH ex: { ?s ?p ?o }}
Result:
----------------------
| s | p | o |
======================
| ex:s | ex:p | ex:o |
----------------------
I would expect there to be the other triple { ex:s2 ex:p2 ex:o2 } too, but
apparently that ends up in the default graph instead.
When using Fuseki 1.3.0 I get both triples in the <http://example.com/> graph,
which I think is the correct behaviour.
was:
I found a possible problem with WITH statements in SPARQL Update queries. They
do not seem to affect the INSERT clause in the expected way. The behaviour
appears to have changed since Jena 3.0.0.
To reproduce:
1. Start Fuseki 1.3.1:
./fuseki-server --update --mem /ds
2. Create a triple in the <http://example.com/> graph:
PREFIX ex: <http://example.com/>
INSERT DATA { GRAPH ex: { ex:s ex:p ex:o }}
3. Run an update query using WITH:
PREFIX ex: <http://example.com/>
WITH ex:
INSERT { ex:s2 ex:p2 ex:o2 }
WHERE { ?s ?p ?o }
4. Check what you end up in the <http://example.com/> graph:
PREFIX ex: <http://example.com/>
SELECT * WHERE { GRAPH ex: { ?s ?p ?o }}
Result:
----------------------
| s | p | o |
======================
| ex:s | ex:p | ex:o |
----------------------
I would expect there to be the other triple { ex:s2 ex:p2 ex:o2 } too, but
apparently that ends up in the default graph instead.
When using Fuseki 1.3.0 I get both triples in the <http://example.com/> graph,
which I think is the correct behaviour.
> WITH statement doesn't work
> ---------------------------
>
> Key: JENA-1092
> URL: https://issues.apache.org/jira/browse/JENA-1092
> Project: Apache Jena
> Issue Type: Bug
> Affects Versions: Jena 3.0.1
> Environment: Ubuntu 12.04
> java version "1.8.0_66"
> Reporter: Osma Suominen
>
> I found a possible problem with WITH statements in SPARQL Update queries.
> They do not seem to affect the INSERT clause in the expected way. The
> behaviour appears to have changed since Jena 3.0.0.
> To reproduce:
> 1. Start Fuseki 1.3.1:
> ./fuseki-server --update --mem /ds
> 2. Create a triple in the <http://example.com/> graph:
> {noformat}
> PREFIX ex: <http://example.com/>
> INSERT DATA { GRAPH ex: { ex:s ex:p ex:o }}
> {noformat}
> 3. Run an update query using WITH:
> PREFIX ex: <http://example.com/>
> WITH ex:
> INSERT { ex:s2 ex:p2 ex:o2 }
> WHERE { ?s ?p ?o }
> 4. Check what you end up in the <http://example.com/> graph:
> PREFIX ex: <http://example.com/>
> SELECT * WHERE { GRAPH ex: { ?s ?p ?o }}
> Result:
> ----------------------
> | s | p | o |
> ======================
> | ex:s | ex:p | ex:o |
> ----------------------
> I would expect there to be the other triple { ex:s2 ex:p2 ex:o2 } too, but
> apparently that ends up in the default graph instead.
> When using Fuseki 1.3.0 I get both triples in the <http://example.com/>
> graph, which I think is the correct behaviour.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)