Osma,
Could you raise a JIRA so this does not get overlooked?
Thanks
Andy
On 14/11/16 11:12, Osma Suominen wrote:
Hi,
I noticed a behavior change in the Jena 3.1.1 sparql command line tool.
I wonder if this is intentional?
With 3.1.0 I could combine --data and --namedGraph like this:
sparql --data example.nt --namedGraph namedgraph.nt --query query.rq
Here are the contents of the files:
example.nt:
<http://example.org/subj> <http://example.org/prop>
<http://example.org/obj>
namedgraph.nt:
<http://example.org/graph> <http://example.org/prop>
<http://example.org/obj> .
query.rq:
SELECT * { ?s ?p ?o }
The result using Jena 3.1.0:
------------------------------------------------------------------------------------
| s | p | o |
====================================================================================
| <http://example.org/subj> | <http://example.org/prop> |
<http://example.org/obj> |
------------------------------------------------------------------------------------
Result with Jena 3.1.1:
-------------
| s | p | o |
=============
-------------
I get the intended result (the triple from example.nt) with this command
which uses --graph instead of --data:
sparql --graph example.nt --namedGraph namedgraph.nt --query query.rq
So it seems that when combined with a --namedGraph option, the data
specified using --data no longer ends up in the default graph with Jena
3.1.1. If I remove the --namedGraph option, then the problem disappears
and the file specified by --data does end up in the default graph.
I can easily work around this by not using this combination of options
(after all, --graph is the more explicit way of loading data into the
default graph), I was just surprised when a script broke because of this
change.
-Osma