You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Eduardo Fernandez <yo...@gmail.com> on 2013/11/06 19:20:21 UTC

How to set up Fuseki with a UnionGraph as Default Graph?

Hi,

First a little background:
1. This is my first time using a mailing list, so I hope I'm doing it right.
2. I'm fairly new to Semantic Technologies, and I'm not very familiar with
Jena.


I set up a Fuseki server to use it as a SPARQL endpoint for a VIVO install.
I already set up everything and it seems to be working OK. If I run a query
like:

SELECT * WHERE { ?s ?p ?o }

I don't get any results (I believe that is expected as VIVO uses named
graphs?). If I run a query against the Union Graph, e.g.:

SELECT *
WHERE { GRAPH <urn:x-arq:UnionGraph>
{ ?s ?p ?o }}

I do get results, and that's OK.

So, I'm having some issues trying to make a config file that sets up the
UnionGraph as the default graph, so I can run queries without having to use
the <urn:x-arq:UnionGraph> IRI.

I've read the mailing lists regarding VIVO and SDB (VIVO uses SDB). I've
tried using the config file John Fereira posted a while ago. Here is the
relevant part of the config file:


<#sdb-part> rdf:type ja:RDFDataset ; # If ja:namedGraph is used here, there
is no correspondence # with the name in the SDB store. ja:defaultGraph
<#sdb-one-graph> ; .

<#sdb-one-graph> a sdb:Model ; sdb:dataset <#dataset> ; sdb:graphName
<urn:x-arq:UnionGraph> ;



But when I start Fuseki it gives me an exception:

"com.hp.hpl.jena.sparql.ARQException: Found two matches: var ?root...."



Also, in the configuration page for SDB says that I can set the
"SDB.unionDefaultGraph" option to true, but I don't know if it can be used
in a config file for Fuseki or just when writing apps on Java with SDB ???


Any help would be highly appreciated


Regards,

Eduardo Fernández

Re: How to set up Fuseki with a UnionGraph as Default Graph?

Posted by Eduardo Fernandez <yo...@gmail.com>.
Thanks, for the anwser Andy, I forgot to mention that I've already tried to
setting it with

[] rdf:type fuseki:Server ;
   ...
   ja:context [ ja:cxtName "sdb:unionDefaultGraph" ;
                ja:cxtValue "true" ] ;


but it didn't worked.

Anyway, I just ditched my setup and used one John Fereira created, and that
worked for me. (Thanks John!)

Regards,
Eduardo Fernandez


2013/11/7 Andy Seaborne <an...@apache.org>

> YOu can set it from the command line:
>
>
> --set sdb:unionDefaultGraph=true
>
> may work but may tripup on initialization order (registering sdb:
>
> the long form is:
>
> --set 'http://jena.hpl.hp.com/SDB/symbol#unionDefaultGraph=true'
>
> It may be better to set it in the configuration file:
>
> [] rdf:type fuseki:Server ;
>    ...
>    ja:context [ ja:cxtName "sdb:unionDefaultGraph" ;
>                 ja:cxtValue "true" ] ;
>     ..
>
>
> (untested - sorry).
>
> More inline.
>
>
>
> On 06/11/13 18:20, Eduardo Fernandez wrote:
>
>> Hi,
>>
>> First a little background:
>> 1. This is my first time using a mailing list, so I hope I'm doing it
>> right.
>> 2. I'm fairly new to Semantic Technologies, and I'm not very familiar with
>> Jena.
>>
>>
>> I set up a Fuseki server to use it as a SPARQL endpoint for a VIVO
>> install.
>> I already set up everything and it seems to be working OK. If I run a
>> query
>> like:
>>
>> SELECT * WHERE { ?s ?p ?o }
>>
>> I don't get any results (I believe that is expected as VIVO uses named
>> graphs?). If I run a query against the Union Graph, e.g.:
>>
>> SELECT *
>> WHERE { GRAPH <urn:x-arq:UnionGraph>
>> { ?s ?p ?o }}
>>
>> I do get results, and that's OK.
>>
>> So, I'm having some issues trying to make a config file that sets up the
>> UnionGraph as the default graph, so I can run queries without having to
>> use
>> the <urn:x-arq:UnionGraph> IRI.
>>
>> I've read the mailing lists regarding VIVO and SDB (VIVO uses SDB). I've
>> tried using the config file John Fereira posted a while ago. Here is the
>> relevant part of the config file:
>>
>>
>> <#sdb-part> rdf:type ja:RDFDataset ; # If ja:namedGraph is used here,
>> there
>> is no correspondence # with the name in the SDB store. ja:defaultGraph
>> <#sdb-one-graph> ; .
>>
>> <#sdb-one-graph> a sdb:Model ; sdb:dataset <#dataset> ; sdb:graphName
>> <urn:x-arq:UnionGraph> ;
>>
>
> That is a general dataset with an SDB graph in it - it'll work but is
> limited if you want multiple graph access.
>
>
>
>>
>>
>> But when I start Fuseki it gives me an exception:
>>
>> "com.hp.hpl.jena.sparql.ARQException: Found two matches: var ?root...."
>>
>
> Different issue - something in the configuration file is wrong such as
> having two types, or using the same uri twice.
>
> Post the config file.
>
>
>
>>
>>
>> Also, in the configuration page for SDB says that I can set the
>> "SDB.unionDefaultGraph" option to true, but I don't know if it can be used
>> in a config file for Fuseki or just when writing apps on Java with SDB ???
>>
>>
>> Any help would be highly appreciated
>>
>>
>> Regards,
>>
>> Eduardo Fernández
>>
>
>         Andy
>
>
>>
>

Re: How to set up Fuseki with a UnionGraph as Default Graph?

Posted by Andy Seaborne <an...@apache.org>.
YOu can set it from the command line:


--set sdb:unionDefaultGraph=true

may work but may tripup on initialization order (registering sdb:

the long form is:

--set 'http://jena.hpl.hp.com/SDB/symbol#unionDefaultGraph=true'

It may be better to set it in the configuration file:

[] rdf:type fuseki:Server ;
    ...
    ja:context [ ja:cxtName "sdb:unionDefaultGraph" ;
                 ja:cxtValue "true" ] ;
     ..


(untested - sorry).

More inline.


On 06/11/13 18:20, Eduardo Fernandez wrote:
> Hi,
>
> First a little background:
> 1. This is my first time using a mailing list, so I hope I'm doing it right.
> 2. I'm fairly new to Semantic Technologies, and I'm not very familiar with
> Jena.
>
>
> I set up a Fuseki server to use it as a SPARQL endpoint for a VIVO install.
> I already set up everything and it seems to be working OK. If I run a query
> like:
>
> SELECT * WHERE { ?s ?p ?o }
>
> I don't get any results (I believe that is expected as VIVO uses named
> graphs?). If I run a query against the Union Graph, e.g.:
>
> SELECT *
> WHERE { GRAPH <urn:x-arq:UnionGraph>
> { ?s ?p ?o }}
>
> I do get results, and that's OK.
>
> So, I'm having some issues trying to make a config file that sets up the
> UnionGraph as the default graph, so I can run queries without having to use
> the <urn:x-arq:UnionGraph> IRI.
>
> I've read the mailing lists regarding VIVO and SDB (VIVO uses SDB). I've
> tried using the config file John Fereira posted a while ago. Here is the
> relevant part of the config file:
>
>
> <#sdb-part> rdf:type ja:RDFDataset ; # If ja:namedGraph is used here, there
> is no correspondence # with the name in the SDB store. ja:defaultGraph
> <#sdb-one-graph> ; .
>
> <#sdb-one-graph> a sdb:Model ; sdb:dataset <#dataset> ; sdb:graphName
> <urn:x-arq:UnionGraph> ;

That is a general dataset with an SDB graph in it - it'll work but is 
limited if you want multiple graph access.

>
>
>
> But when I start Fuseki it gives me an exception:
>
> "com.hp.hpl.jena.sparql.ARQException: Found two matches: var ?root...."

Different issue - something in the configuration file is wrong such as 
having two types, or using the same uri twice.

Post the config file.

>
>
>
> Also, in the configuration page for SDB says that I can set the
> "SDB.unionDefaultGraph" option to true, but I don't know if it can be used
> in a config file for Fuseki or just when writing apps on Java with SDB ???
>
>
> Any help would be highly appreciated
>
>
> Regards,
>
> Eduardo Fernández

	Andy

>