You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/11/15 17:22:58 UTC

[jira] [Commented] (JENA-1261) command line sparql: --namedGraph clobbers --data?

    [ https://issues.apache.org/jira/browse/JENA-1261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15667713#comment-15667713 ] 

ASF subversion and git services commented on JENA-1261:
-------------------------------------------------------

Commit 968e24bb212c7a7edca68d2ad17b8747f8dee6ac in jena's branch refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=968e24b ]

JENA-1261: add triples, don't underwrite graphs.

> 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)