Osma Suominen created JENA-1261:
-----------------------------------

             Summary: command line sparql: --namedGraph clobbers --data?
                 Key: JENA-1261
                 URL: https://issues.apache.org/jira/browse/JENA-1261
             Project: Apache Jena
          Issue Type: Bug
          Components: Cmd line tools
    Affects Versions: Jena 3.1.1
            Reporter: Osma Suominen


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:
{noformat}
sparql --data example.nt --namedGraph namedgraph.nt --query query.rq
{noformat}

Here are the contents of the files:

example.nt:
{noformat}
<http://example.org/subj> <http://example.org/prop> <http://example.org/obj> .
{noformat}

namedgraph.nt:
{noformat}
<http://example.org/graph> <http://example.org/prop> <http://example.org/obj> 
{noformat}
.

query.rq:
{noformat}
SELECT * { ?s ?p ?o }
{noformat}


The result using Jena 3.1.0:
{noformat}
------------------------------------------------------------------------------------
| s                         | p                         | o            |
====================================================================================
| <http://example.org/subj> | <http://example.org/prop> | 
<http://example.org/obj> |
------------------------------------------------------------------------------------
{noformat}


Result with Jena 3.1.1:
{noformat}
-------------
| s | p | o |
=============
-------------
{noformat}


I get the intended result (the triple from example.nt) with this command which 
uses --graph instead of --data:

{noformat}
sparql --graph example.nt --namedGraph namedgraph.nt --query query.rq
{noformat}

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. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to