You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Laura Morales <la...@mail.com> on 2018/11/11 14:49:36 UTC

DatasetTDB2 with separate namedGraphs

Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work

======================================================================
PREFIX fuseki:  <http://jena.apache.org/fuseki#>
PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
PREFIX tdb:     <http://jena.hpl.hp.com/2008/tdb#>
PREFIX tdb2:    <http://jena.apache.org/2016/tdb#>
PREFIX text:    <http://jena.apache.org/text#>

:dataset a ja:RDFDataset .

:dataset ja:namedGraph
[
    ja:graphName <http://example.org/graph1> ;
    ja:graph
    [
        a tdb2:GraphTDB2 ;
        tdb2:location "/path/to/dataset1/" ;
    ]
] .

:dataset ja:namedGraph
[
    ja:graphName <http://example.org/graph2> ;
    ja:graph
    [
        a tdb2:GraphTDB2 ;
        tdb2:location "/path/to/dataset2/" ;
    ]
] .
======================================================================

I get this error when I try to query it:

org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2>
	at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
	at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
	at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
	at arq.query.getDataset(query.java:176)
	at arq.query.queryExec(query.java:213)
	at arq.query.exec(query.java:153)
	at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
	at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
	at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
	at tdb2.tdbquery.main(tdbquery.java:30)

Re: DatasetTDB2 with separate namedGraphs

Posted by Andy Seaborne <an...@apache.org>.

On 11/11/2018 20:37, Laura Morales wrote:
> FWIW I've copypasted this assembler file https://jena.apache.org/documentation/tdb/assembler.html#mixed-datasets and I've run this command
> 
> $ tdbquery --tdb mixed-datasets.ttl --query <( echo "select * where {?s ?p ?o} limit 1" )
> 
> and I still see the same error:
> 
> org.apache.jena.sparql.ARQException: No such type: <http://jena.hpl.hp.com/2008/tdb#DatasetTDB>

tdb2:DatasetTDB2.

> 
> even if I remove the namedGraph.
> 
> 
> 
>   
>   
> 
> Sent: Sunday, November 11, 2018 at 5:50 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> TDB2 is certainly younger, but that means both that it has capabilities that TDB1 doesn't (like MR+SW) and that it lacks utilities and functions that TDB1 has. For example, the issue with compaction.
> 
> There is no need to load a TDB1 database from HTTP (unless you have other constraints). Just use tdbloader or tdbloader2. tdbloader will work against an extant TDB1 database.
> 
> TDB2 is a more-or-less independent code base from TDB1, not a new version of the same codebase, so there is no reason to think that bugs in TDB1 are fixed in TDB2. If anything TDB2 is newer and therefore not as battle-tested as TDB1, so it is more likely to have bugs. TDB1 is not going anywhere anytime soon.
> 
> We certainly appreciate people using TDB2 and giving feedback to the project, but if you have a problem with the lack of automated compaction and no specific concrete reason to use TDB2, it might be better to use TDB1. YMMV.
> 
> ajs6f
> 
>> On Nov 11, 2018, at 11:06 AM, Laura Morales <la...@mail.com> wrote:
>>
>> To be completely honest, simply because TDB2 is advertised as "next generation" storage for jena so I prefer to stick with the newer version and try to avoid any TDB problems that are fixed in TDB2. Besides, some graphs are GBs in size so loading them via tdb2.* utilities seems more appropriate to me than GB-size HTTP requests...
>>
>>
>>
>>
>> Sent: Sunday, November 11, 2018 at 4:49 PM
>> From: ajs6f <aj...@apache.org>
>> To: users@jena.apache.org
>> Subject: Re: DatasetTDB2 with separate namedGraphs
>> Then let me ask a different question-- is there a reason in particular that you are using TDB2? TDB1 doesn't have the monotonically-increasing size issue, and you could use the well-defined and standardized SPARQL Graph Store protocol [1] to insert and delete graphs.
>>
>> ajs6f
>>
>> [1] https://www.w3.org/TR/sparql11-http-rdf-update/
>>
>>> On Nov 11, 2018, at 10:42 AM, Laura Morales <la...@mail.com> wrote:
>>>
>>>> Is there some reason you don't just copy the graphs into one database?
>>>
>>> Because I need to swap graphs frequently, for example delete Graph1 and insert Graph2. If I put all of them into the same dataset I would have to manage the database size or tdb2.tdbcompact it often since the database only increase in size if I'm right. So, with separate databases, I can just delete the whole folder and replace it with something else.
>>>
>>>
>>>
>>> Sent: Sunday, November 11, 2018 at 4:32 PM
>>> From: ajs6f <aj...@apache.org>
>>> To: users@jena.apache.org
>>> Subject: Re: DatasetTDB2 with separate namedGraphs
>>> Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?
>>>
>>> In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:
>>>
>>> https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl[https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl][https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl[https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl]]
>>>
>>> ajs6f
>>>
>>>> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>>>>
>>>> More or less, yes.
>>>> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
>>>> Then I'd like to query it like this: SELECT * FROM Graph1...
>>>>
>>>>
>>>>
>>>> Sent: Sunday, November 11, 2018 at 3:54 PM
>>>> From: ajs6f <aj...@apache.org>
>>>> To: users@jena.apache.org
>>>> Subject: Re: DatasetTDB2 with separate namedGraphs
>>>> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>>>>
>>>> ajs6f
>>>>
>>>>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>>>>
>>>>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>>>>
>>>>> ======================================================================
>>>>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]]]>
>>>>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]]]>
>>>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]]]>
>>>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]]]>
>>>>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]]]>
>>>>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]]]>
>>>>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]]]>
>>>>>
>>>>> :dataset a ja:RDFDataset .
>>>>>
>>>>> :dataset ja:namedGraph
>>>>> [
>>>>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]]]> ;
>>>>> ja:graph
>>>>> [
>>>>> a tdb2:GraphTDB2 ;
>>>>> tdb2:location "/path/to/dataset1/" ;
>>>>> ]
>>>>> ] .
>>>>>
>>>>> :dataset ja:namedGraph
>>>>> [
>>>>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]]]> ;
>>>>> ja:graph
>>>>> [
>>>>> a tdb2:GraphTDB2 ;
>>>>> tdb2:location "/path/to/dataset2/" ;
>>>>> ]
>>>>> ] .
>>>>> ======================================================================
>>>>>
>>>>> I get this error when I try to query it:
>>>>>
>>>>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]]]>
>>>>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>>>>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>>>>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>>>>> at arq.query.getDataset(query.java:176)
>>>>> at arq.query.queryExec(query.java:213)
>>>>> at arq.query.exec(query.java:153)
>>>>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>>>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>>>> at tdb2.tdbquery.main(tdbquery.java:30)
>>>>
>>>
>>
>   
> 

Re: DatasetTDB2 with separate namedGraphs

Posted by Laura Morales <la...@mail.com>.
FWIW I've copypasted this assembler file https://jena.apache.org/documentation/tdb/assembler.html#mixed-datasets and I've run this command

$ tdbquery --tdb mixed-datasets.ttl --query <( echo "select * where {?s ?p ?o} limit 1" )

and I still see the same error:

org.apache.jena.sparql.ARQException: No such type: <http://jena.hpl.hp.com/2008/tdb#DatasetTDB>

even if I remove the namedGraph.



 
 

Sent: Sunday, November 11, 2018 at 5:50 PM
From: ajs6f <aj...@apache.org>
To: users@jena.apache.org
Subject: Re: DatasetTDB2 with separate namedGraphs
TDB2 is certainly younger, but that means both that it has capabilities that TDB1 doesn't (like MR+SW) and that it lacks utilities and functions that TDB1 has. For example, the issue with compaction.

There is no need to load a TDB1 database from HTTP (unless you have other constraints). Just use tdbloader or tdbloader2. tdbloader will work against an extant TDB1 database.

TDB2 is a more-or-less independent code base from TDB1, not a new version of the same codebase, so there is no reason to think that bugs in TDB1 are fixed in TDB2. If anything TDB2 is newer and therefore not as battle-tested as TDB1, so it is more likely to have bugs. TDB1 is not going anywhere anytime soon.

We certainly appreciate people using TDB2 and giving feedback to the project, but if you have a problem with the lack of automated compaction and no specific concrete reason to use TDB2, it might be better to use TDB1. YMMV.

ajs6f

> On Nov 11, 2018, at 11:06 AM, Laura Morales <la...@mail.com> wrote:
>
> To be completely honest, simply because TDB2 is advertised as "next generation" storage for jena so I prefer to stick with the newer version and try to avoid any TDB problems that are fixed in TDB2. Besides, some graphs are GBs in size so loading them via tdb2.* utilities seems more appropriate to me than GB-size HTTP requests...
>
>
>
>
> Sent: Sunday, November 11, 2018 at 4:49 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> Then let me ask a different question-- is there a reason in particular that you are using TDB2? TDB1 doesn't have the monotonically-increasing size issue, and you could use the well-defined and standardized SPARQL Graph Store protocol [1] to insert and delete graphs.
>
> ajs6f
>
> [1] https://www.w3.org/TR/sparql11-http-rdf-update/
>
>> On Nov 11, 2018, at 10:42 AM, Laura Morales <la...@mail.com> wrote:
>>
>>> Is there some reason you don't just copy the graphs into one database?
>>
>> Because I need to swap graphs frequently, for example delete Graph1 and insert Graph2. If I put all of them into the same dataset I would have to manage the database size or tdb2.tdbcompact it often since the database only increase in size if I'm right. So, with separate databases, I can just delete the whole folder and replace it with something else.
>>
>>
>>
>> Sent: Sunday, November 11, 2018 at 4:32 PM
>> From: ajs6f <aj...@apache.org>
>> To: users@jena.apache.org
>> Subject: Re: DatasetTDB2 with separate namedGraphs
>> Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?
>>
>> In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:
>>
>> https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl[https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl][https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl[https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl]]
>>
>> ajs6f
>>
>>> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>>>
>>> More or less, yes.
>>> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
>>> Then I'd like to query it like this: SELECT * FROM Graph1...
>>>
>>>
>>>
>>> Sent: Sunday, November 11, 2018 at 3:54 PM
>>> From: ajs6f <aj...@apache.org>
>>> To: users@jena.apache.org
>>> Subject: Re: DatasetTDB2 with separate namedGraphs
>>> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>>>
>>> ajs6f
>>>
>>>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>>>
>>>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>>>
>>>> ======================================================================
>>>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]]]>
>>>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]]]>
>>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]]]>
>>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]]]>
>>>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]]]>
>>>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]]]>
>>>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]]]>
>>>>
>>>> :dataset a ja:RDFDataset .
>>>>
>>>> :dataset ja:namedGraph
>>>> [
>>>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]]]> ;
>>>> ja:graph
>>>> [
>>>> a tdb2:GraphTDB2 ;
>>>> tdb2:location "/path/to/dataset1/" ;
>>>> ]
>>>> ] .
>>>>
>>>> :dataset ja:namedGraph
>>>> [
>>>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]]]> ;
>>>> ja:graph
>>>> [
>>>> a tdb2:GraphTDB2 ;
>>>> tdb2:location "/path/to/dataset2/" ;
>>>> ]
>>>> ] .
>>>> ======================================================================
>>>>
>>>> I get this error when I try to query it:
>>>>
>>>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]]]>
>>>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>>>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>>>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>>>> at arq.query.getDataset(query.java:176)
>>>> at arq.query.queryExec(query.java:213)
>>>> at arq.query.exec(query.java:153)
>>>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>>> at tdb2.tdbquery.main(tdbquery.java:30)
>>>
>>
>
 

Re: DatasetTDB2 with separate namedGraphs

Posted by ajs6f <aj...@apache.org>.
TDB2 is certainly younger, but that means both that it has capabilities that TDB1 doesn't (like MR+SW) and that it lacks utilities and functions that TDB1 has. For example, the issue with compaction.

There is no need to load a TDB1 database from HTTP (unless you have other constraints). Just use tdbloader or tdbloader2. tdbloader will work against an extant TDB1 database.

TDB2 is a more-or-less independent code base from TDB1, not a new version of the same codebase, so there is no reason to think that bugs in TDB1 are fixed in TDB2. If anything TDB2 is newer and therefore not as battle-tested as TDB1, so it is more likely to have bugs. TDB1 is not going anywhere anytime soon.

We certainly appreciate people using TDB2 and giving feedback to the project, but if you have a problem with the lack of automated compaction and no specific concrete reason to use TDB2, it might be better to use TDB1. YMMV.

ajs6f

> On Nov 11, 2018, at 11:06 AM, Laura Morales <la...@mail.com> wrote:
> 
> To be completely honest, simply because TDB2 is advertised as "next generation" storage for jena so I prefer to stick with the newer version and try to avoid any TDB problems that are fixed in TDB2. Besides, some graphs are GBs in size so loading them via tdb2.* utilities seems more appropriate to me than GB-size HTTP requests...
> 
>  
>  
> 
> Sent: Sunday, November 11, 2018 at 4:49 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> Then let me ask a different question-- is there a reason in particular that you are using TDB2? TDB1 doesn't have the monotonically-increasing size issue, and you could use the well-defined and standardized SPARQL Graph Store protocol [1] to insert and delete graphs.
> 
> ajs6f
> 
> [1] https://www.w3.org/TR/sparql11-http-rdf-update/
> 
>> On Nov 11, 2018, at 10:42 AM, Laura Morales <la...@mail.com> wrote:
>> 
>>> Is there some reason you don't just copy the graphs into one database?
>> 
>> Because I need to swap graphs frequently, for example delete Graph1 and insert Graph2. If I put all of them into the same dataset I would have to manage the database size or tdb2.tdbcompact it often since the database only increase in size if I'm right. So, with separate databases, I can just delete the whole folder and replace it with something else.
>> 
>> 
>> 
>> Sent: Sunday, November 11, 2018 at 4:32 PM
>> From: ajs6f <aj...@apache.org>
>> To: users@jena.apache.org
>> Subject: Re: DatasetTDB2 with separate namedGraphs
>> Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?
>> 
>> In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:
>> 
>> https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl[https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl]
>> 
>> ajs6f
>> 
>>> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>>> 
>>> More or less, yes.
>>> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
>>> Then I'd like to query it like this: SELECT * FROM Graph1...
>>> 
>>> 
>>> 
>>> Sent: Sunday, November 11, 2018 at 3:54 PM
>>> From: ajs6f <aj...@apache.org>
>>> To: users@jena.apache.org
>>> Subject: Re: DatasetTDB2 with separate namedGraphs
>>> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>>> 
>>> ajs6f
>>> 
>>>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>>> 
>>>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>>> 
>>>> ======================================================================
>>>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]]>
>>>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]]>
>>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]]>
>>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]]>
>>>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]]>
>>>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]]>
>>>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]]>
>>>> 
>>>> :dataset a ja:RDFDataset .
>>>> 
>>>> :dataset ja:namedGraph
>>>> [
>>>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]]> ;
>>>> ja:graph
>>>> [
>>>> a tdb2:GraphTDB2 ;
>>>> tdb2:location "/path/to/dataset1/" ;
>>>> ]
>>>> ] .
>>>> 
>>>> :dataset ja:namedGraph
>>>> [
>>>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]]> ;
>>>> ja:graph
>>>> [
>>>> a tdb2:GraphTDB2 ;
>>>> tdb2:location "/path/to/dataset2/" ;
>>>> ]
>>>> ] .
>>>> ======================================================================
>>>> 
>>>> I get this error when I try to query it:
>>>> 
>>>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]]>
>>>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>>>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>>>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>>>> at arq.query.getDataset(query.java:176)
>>>> at arq.query.queryExec(query.java:213)
>>>> at arq.query.exec(query.java:153)
>>>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>>> at tdb2.tdbquery.main(tdbquery.java:30)
>>> 
>> 
>  


Re: DatasetTDB2 with separate namedGraphs

Posted by Laura Morales <la...@mail.com>.
To be completely honest, simply because TDB2 is advertised as "next generation" storage for jena so I prefer to stick with the newer version and try to avoid any TDB problems that are fixed in TDB2. Besides, some graphs are GBs in size so loading them via tdb2.* utilities seems more appropriate to me than GB-size HTTP requests...

 
 

Sent: Sunday, November 11, 2018 at 4:49 PM
From: ajs6f <aj...@apache.org>
To: users@jena.apache.org
Subject: Re: DatasetTDB2 with separate namedGraphs
Then let me ask a different question-- is there a reason in particular that you are using TDB2? TDB1 doesn't have the monotonically-increasing size issue, and you could use the well-defined and standardized SPARQL Graph Store protocol [1] to insert and delete graphs.

ajs6f

[1] https://www.w3.org/TR/sparql11-http-rdf-update/

> On Nov 11, 2018, at 10:42 AM, Laura Morales <la...@mail.com> wrote:
>
>> Is there some reason you don't just copy the graphs into one database?
>
> Because I need to swap graphs frequently, for example delete Graph1 and insert Graph2. If I put all of them into the same dataset I would have to manage the database size or tdb2.tdbcompact it often since the database only increase in size if I'm right. So, with separate databases, I can just delete the whole folder and replace it with something else.
>
>
>
> Sent: Sunday, November 11, 2018 at 4:32 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?
>
> In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:
>
> https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl[https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl]
>
> ajs6f
>
>> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>>
>> More or less, yes.
>> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
>> Then I'd like to query it like this: SELECT * FROM Graph1...
>>
>>
>>
>> Sent: Sunday, November 11, 2018 at 3:54 PM
>> From: ajs6f <aj...@apache.org>
>> To: users@jena.apache.org
>> Subject: Re: DatasetTDB2 with separate namedGraphs
>> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>>
>> ajs6f
>>
>>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>>
>>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>>
>>> ======================================================================
>>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]]>
>>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]]>
>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]]>
>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]]>
>>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]]>
>>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]]>
>>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]]>
>>>
>>> :dataset a ja:RDFDataset .
>>>
>>> :dataset ja:namedGraph
>>> [
>>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]]> ;
>>> ja:graph
>>> [
>>> a tdb2:GraphTDB2 ;
>>> tdb2:location "/path/to/dataset1/" ;
>>> ]
>>> ] .
>>>
>>> :dataset ja:namedGraph
>>> [
>>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]]> ;
>>> ja:graph
>>> [
>>> a tdb2:GraphTDB2 ;
>>> tdb2:location "/path/to/dataset2/" ;
>>> ]
>>> ] .
>>> ======================================================================
>>>
>>> I get this error when I try to query it:
>>>
>>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]]>
>>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>>> at arq.query.getDataset(query.java:176)
>>> at arq.query.queryExec(query.java:213)
>>> at arq.query.exec(query.java:153)
>>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>> at tdb2.tdbquery.main(tdbquery.java:30)
>>
>
 

Re: DatasetTDB2 with separate namedGraphs

Posted by ajs6f <aj...@apache.org>.
Then let me ask a different question-- is there a reason in particular that you are using TDB2? TDB1 doesn't have the monotonically-increasing size issue, and you could use the well-defined and standardized SPARQL Graph Store protocol [1] to insert and delete graphs.

ajs6f

[1] https://www.w3.org/TR/sparql11-http-rdf-update/

> On Nov 11, 2018, at 10:42 AM, Laura Morales <la...@mail.com> wrote:
> 
>> Is there some reason you don't just copy the graphs into one database?
> 
> Because I need to swap graphs frequently, for example delete Graph1 and insert Graph2. If I put all of them into the same dataset I would have to manage the database size or tdb2.tdbcompact it often since the database only increase in size if I'm right. So, with separate databases, I can just delete the whole folder and replace it with something else.
>  
>  
> 
> Sent: Sunday, November 11, 2018 at 4:32 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?
> 
> In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:
> 
> https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl
> 
> ajs6f
> 
>> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>> 
>> More or less, yes.
>> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
>> Then I'd like to query it like this: SELECT * FROM Graph1...
>> 
>> 
>> 
>> Sent: Sunday, November 11, 2018 at 3:54 PM
>> From: ajs6f <aj...@apache.org>
>> To: users@jena.apache.org
>> Subject: Re: DatasetTDB2 with separate namedGraphs
>> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>> 
>> ajs6f
>> 
>>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>> 
>>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>> 
>>> ======================================================================
>>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]>
>>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]>
>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]>
>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]>
>>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]>
>>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]>
>>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]>
>>> 
>>> :dataset a ja:RDFDataset .
>>> 
>>> :dataset ja:namedGraph
>>> [
>>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]> ;
>>> ja:graph
>>> [
>>> a tdb2:GraphTDB2 ;
>>> tdb2:location "/path/to/dataset1/" ;
>>> ]
>>> ] .
>>> 
>>> :dataset ja:namedGraph
>>> [
>>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]> ;
>>> ja:graph
>>> [
>>> a tdb2:GraphTDB2 ;
>>> tdb2:location "/path/to/dataset2/" ;
>>> ]
>>> ] .
>>> ======================================================================
>>> 
>>> I get this error when I try to query it:
>>> 
>>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]>
>>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>>> at arq.query.getDataset(query.java:176)
>>> at arq.query.queryExec(query.java:213)
>>> at arq.query.exec(query.java:153)
>>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>> at tdb2.tdbquery.main(tdbquery.java:30)
>> 
>  


Re: DatasetTDB2 with separate namedGraphs

Posted by Laura Morales <la...@mail.com>.
> Is there some reason you don't just copy the graphs into one database?

Because I need to swap graphs frequently, for example delete Graph1 and insert Graph2. If I put all of them into the same dataset I would have to manage the database size or tdb2.tdbcompact it often since the database only increase in size if I'm right. So, with separate databases, I can just delete the whole folder and replace it with something else.
 
 

Sent: Sunday, November 11, 2018 at 4:32 PM
From: ajs6f <aj...@apache.org>
To: users@jena.apache.org
Subject: Re: DatasetTDB2 with separate namedGraphs
Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?

In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:

https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl

ajs6f

> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>
> More or less, yes.
> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
> Then I'd like to query it like this: SELECT * FROM Graph1...
>
>
>
> Sent: Sunday, November 11, 2018 at 3:54 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>
> ajs6f
>
>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>
>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>
>> ======================================================================
>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]>
>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]>
>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]>
>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]>
>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]>
>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]>
>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]>
>>
>> :dataset a ja:RDFDataset .
>>
>> :dataset ja:namedGraph
>> [
>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]> ;
>> ja:graph
>> [
>> a tdb2:GraphTDB2 ;
>> tdb2:location "/path/to/dataset1/" ;
>> ]
>> ] .
>>
>> :dataset ja:namedGraph
>> [
>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]> ;
>> ja:graph
>> [
>> a tdb2:GraphTDB2 ;
>> tdb2:location "/path/to/dataset2/" ;
>> ]
>> ] .
>> ======================================================================
>>
>> I get this error when I try to query it:
>>
>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]>
>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>> at arq.query.getDataset(query.java:176)
>> at arq.query.queryExec(query.java:213)
>> at arq.query.exec(query.java:153)
>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>> at tdb2.tdbquery.main(tdbquery.java:30)
>
 

Re: DatasetTDB2 with separate namedGraphs

Posted by Laura Morales <la...@mail.com>.
aww fuck my life I never thought about that! Well at least I hope this thread will be useful to others with the same problem in the future... Seems to work smoothly, thank you so much for the help.
 
 

Sent: Monday, November 12, 2018 at 10:30 AM
From: "Andy Seaborne" <an...@apache.org>
To: users@jena.apache.org
Subject: Re: DatasetTDB2 with separate namedGraphs
Work for me in jena 3.9.0

sparql --desc assem.ttl 'ASK{}'

=> Yes
and two DBs created.

tdbquery is the wrong command - you not executing a query over a TDB
dataset but over a general dataset, which happens to contain graphs from
TDB - they could be from anything - or a mix.

Andy

On 12/11/2018 08:58, Laura Morales wrote:
> OK maybe this is something interesting. This is my assembler file:
>
> ============================================================
> PREFIX : <http://example.org/>
> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]>
> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]>
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]>
> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]>
> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]>
> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#]>
>
> <#dataset> rdf:type ja:RDFDataset ;
> ja:namedGraph
> [ ja:graphName :g1 ;
> ja:graph :graph1 ] ;
> ja:namedGraph
> [ ja:graphName :g2 ;
> ja:graph :graph2 ] ;
> .
>
> :graph1 a tdb:GraphTDB ;
> tdb:location "g1";
> .
>
> :graph2 a tdb:GraphTDB ;
> tdb:location "g2" ;
> .
> ============================================================
>
> With jena v3.9.0 I can *not* get this to work, when I run a query I see this error:
>
> org.apache.jena.sparql.ARQException: No such type: <http://jena.hpl.hp.com/2008/tdb#DatasetTDB[http://jena.hpl.hp.com/2008/tdb#DatasetTDB]>
> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
> at tdb.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:85)
> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
> at arq.query.getDataset(query.java:176)
> at arq.query.queryExec(query.java:213)
> at arq.query.exec(query.java:153)
> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
> at tdb.tdbquery.main(tdbquery.java:33)
>
> HOWEVER: this does seem to work with jena v3.0.0. If I execute this query
>
> tdbquery --tdb config.ttl --query <(echo "select * where { graph <http://example.org/g2[http://example.org/g2]> {?s ?p ?o} } offset 1 limit 1")
>
> I do see results as expected (from graph2). On the other hand this query
>
> tdbquery --tdb config.ttl --query <(echo "select * from <http://example.org/g2[http://example.org/g2]> where {?s ?p ?o} offset 1 limit 1")
>
> doesn't throw any errors but it returns zero results, which looks strange to me as I would expect it to return the same results of the previous query.
>
> So is this some regression with jena v3.9.0? Or is it jena v3.0.0 that seems to work but shouldn't work instead?
>
>
>
>
>
>
>
>
>
>
>
> Sent: Monday, November 12, 2018 at 8:25 AM
> From: "Laura Morales" <la...@mail.com>
> To: users@jena.apache.org
> Cc: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> Andy: is this possible?
>
>
>
> Sent: Sunday, November 11, 2018 at 4:32 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?
>
> In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:
>
> https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl[https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl]
>
> ajs6f
>
>> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>>
>> More or less, yes.
>> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
>> Then I'd like to query it like this: SELECT * FROM Graph1...
>>
>>
>>
>> Sent: Sunday, November 11, 2018 at 3:54 PM
>> From: ajs6f <aj...@apache.org>
>> To: users@jena.apache.org
>> Subject: Re: DatasetTDB2 with separate namedGraphs
>> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>>
>> ajs6f
>>
>>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>>
>>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>>
>>> ======================================================================
>>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]]]>
>>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]]]>
>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]]]>
>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]]]>
>>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]]]>
>>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]]]>
>>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]]]>
>>>
>>> :dataset a ja:RDFDataset .
>>>
>>> :dataset ja:namedGraph
>>> [
>>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]]]> ;
>>> ja:graph
>>> [
>>> a tdb2:GraphTDB2 ;
>>> tdb2:location "/path/to/dataset1/" ;
>>> ]
>>> ] .
>>>
>>> :dataset ja:namedGraph
>>> [
>>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]]]> ;
>>> ja:graph
>>> [
>>> a tdb2:GraphTDB2 ;
>>> tdb2:location "/path/to/dataset2/" ;
>>> ]
>>> ] .
>>> ======================================================================
>>>
>>> I get this error when I try to query it:
>>>
>>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]]]>
>>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>>> at arq.query.getDataset(query.java:176)
>>> at arq.query.queryExec(query.java:213)
>>> at arq.query.exec(query.java:153)
>>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>> at tdb2.tdbquery.main(tdbquery.java:30)
>>
>
>

Re: DatasetTDB2 with separate namedGraphs

Posted by Andy Seaborne <an...@apache.org>.
Work for me in jena 3.9.0

sparql --desc assem.ttl 'ASK{}'

=> Yes
and two DBs created.

tdbquery is the wrong command - you not executing a query over a TDB 
dataset but over a general dataset, which happens to contain graphs from 
TDB - they could be from anything - or a mix.

     Andy

On 12/11/2018 08:58, Laura Morales wrote:
> OK maybe this is something interesting. This is my assembler file:
> 
> ============================================================
> PREFIX :        <http://example.org/>
> PREFIX fuseki:  <http://jena.apache.org/fuseki#>
> PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>
> PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
> PREFIX tdb:     <http://jena.hpl.hp.com/2008/tdb#>
> PREFIX tdb2:    <http://jena.apache.org/2016/tdb#>
> PREFIX text:    <http://jena.apache.org/text#>
> 
> <#dataset> rdf:type      ja:RDFDataset ;
>       ja:namedGraph
>          [ ja:graphName      :g1 ;
>            ja:graph          :graph1 ] ;
>       ja:namedGraph
>          [ ja:graphName      :g2 ;
>            ja:graph          :graph2 ] ;
>       .
> 
> :graph1 a tdb:GraphTDB ;
>      tdb:location "g1";
>      .
> 
> :graph2 a tdb:GraphTDB ;
>      tdb:location "g2" ;
>      .
> ============================================================
> 
> With jena v3.9.0 I can *not* get this to work, when I run a query I see this error:
> 
> org.apache.jena.sparql.ARQException: No such type: <http://jena.hpl.hp.com/2008/tdb#DatasetTDB>
> 	at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
> 	at tdb.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:85)
> 	at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
> 	at arq.query.getDataset(query.java:176)
> 	at arq.query.queryExec(query.java:213)
> 	at arq.query.exec(query.java:153)
> 	at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
> 	at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
> 	at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
> 	at tdb.tdbquery.main(tdbquery.java:33)
> 
> HOWEVER: this does seem to work with jena v3.0.0. If I execute this query
> 
> tdbquery --tdb config.ttl --query <(echo "select * where { graph <http://example.org/g2> {?s ?p ?o} } offset 1 limit 1")
> 
> I do see results as expected (from graph2). On the other hand this query
> 
> tdbquery --tdb config.ttl --query <(echo "select * from <http://example.org/g2> where {?s ?p ?o} offset 1 limit 1")
> 
> doesn't throw any errors but it returns zero results, which looks strange to me as I would expect it to return the same results of the previous query.
> 
> So is this some regression with jena v3.9.0? Or is it jena v3.0.0 that seems to work but shouldn't work instead?
> 
> 
> 
> 
> 
> 
> 
> 
>   
>   
> 
> Sent: Monday, November 12, 2018 at 8:25 AM
> From: "Laura Morales" <la...@mail.com>
> To: users@jena.apache.org
> Cc: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> Andy: is this possible?
>   
>   
> 
> Sent: Sunday, November 11, 2018 at 4:32 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?
> 
> In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:
> 
> https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl
> 
> ajs6f
> 
>> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>>
>> More or less, yes.
>> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
>> Then I'd like to query it like this: SELECT * FROM Graph1...
>>
>>
>>
>> Sent: Sunday, November 11, 2018 at 3:54 PM
>> From: ajs6f <aj...@apache.org>
>> To: users@jena.apache.org
>> Subject: Re: DatasetTDB2 with separate namedGraphs
>> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>>
>> ajs6f
>>
>>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>>
>>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>>
>>> ======================================================================
>>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]]>
>>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]]>
>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]]>
>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]]>
>>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]]>
>>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]]>
>>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]]>
>>>
>>> :dataset a ja:RDFDataset .
>>>
>>> :dataset ja:namedGraph
>>> [
>>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]]> ;
>>> ja:graph
>>> [
>>> a tdb2:GraphTDB2 ;
>>> tdb2:location "/path/to/dataset1/" ;
>>> ]
>>> ] .
>>>
>>> :dataset ja:namedGraph
>>> [
>>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]]> ;
>>> ja:graph
>>> [
>>> a tdb2:GraphTDB2 ;
>>> tdb2:location "/path/to/dataset2/" ;
>>> ]
>>> ] .
>>> ======================================================================
>>>
>>> I get this error when I try to query it:
>>>
>>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]]>
>>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>>> at arq.query.getDataset(query.java:176)
>>> at arq.query.queryExec(query.java:213)
>>> at arq.query.exec(query.java:153)
>>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>> at tdb2.tdbquery.main(tdbquery.java:30)
>>
>   
> 

Re: DatasetTDB2 with separate namedGraphs

Posted by Laura Morales <la...@mail.com>.
OK maybe this is something interesting. This is my assembler file:

============================================================
PREFIX :        <http://example.org/>
PREFIX fuseki:  <http://jena.apache.org/fuseki#>
PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
PREFIX tdb:     <http://jena.hpl.hp.com/2008/tdb#>
PREFIX tdb2:    <http://jena.apache.org/2016/tdb#>
PREFIX text:    <http://jena.apache.org/text#>

<#dataset> rdf:type      ja:RDFDataset ;
     ja:namedGraph
        [ ja:graphName      :g1 ;
          ja:graph          :graph1 ] ;
     ja:namedGraph
        [ ja:graphName      :g2 ;
          ja:graph          :graph2 ] ;
     .

:graph1 a tdb:GraphTDB ;
    tdb:location "g1";
    .

:graph2 a tdb:GraphTDB ;
    tdb:location "g2" ;
    .
============================================================

With jena v3.9.0 I can *not* get this to work, when I run a query I see this error:

org.apache.jena.sparql.ARQException: No such type: <http://jena.hpl.hp.com/2008/tdb#DatasetTDB>
	at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
	at tdb.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:85)
	at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
	at arq.query.getDataset(query.java:176)
	at arq.query.queryExec(query.java:213)
	at arq.query.exec(query.java:153)
	at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
	at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
	at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
	at tdb.tdbquery.main(tdbquery.java:33)

HOWEVER: this does seem to work with jena v3.0.0. If I execute this query

tdbquery --tdb config.ttl --query <(echo "select * where { graph <http://example.org/g2> {?s ?p ?o} } offset 1 limit 1")

I do see results as expected (from graph2). On the other hand this query

tdbquery --tdb config.ttl --query <(echo "select * from <http://example.org/g2> where {?s ?p ?o} offset 1 limit 1")

doesn't throw any errors but it returns zero results, which looks strange to me as I would expect it to return the same results of the previous query.

So is this some regression with jena v3.9.0? Or is it jena v3.0.0 that seems to work but shouldn't work instead?








 
 

Sent: Monday, November 12, 2018 at 8:25 AM
From: "Laura Morales" <la...@mail.com>
To: users@jena.apache.org
Cc: users@jena.apache.org
Subject: Re: DatasetTDB2 with separate namedGraphs
Andy: is this possible?
 
 

Sent: Sunday, November 11, 2018 at 4:32 PM
From: ajs6f <aj...@apache.org>
To: users@jena.apache.org
Subject: Re: DatasetTDB2 with separate namedGraphs
Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?

In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:

https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl

ajs6f

> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>
> More or less, yes.
> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
> Then I'd like to query it like this: SELECT * FROM Graph1...
>
>
>
> Sent: Sunday, November 11, 2018 at 3:54 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>
> ajs6f
>
>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>
>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>
>> ======================================================================
>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#][http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]]>
>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]]>
>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]]>
>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]]>
>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]]>
>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]]>
>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]][http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]]>
>>
>> :dataset a ja:RDFDataset .
>>
>> :dataset ja:namedGraph
>> [
>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]][http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]]> ;
>> ja:graph
>> [
>> a tdb2:GraphTDB2 ;
>> tdb2:location "/path/to/dataset1/" ;
>> ]
>> ] .
>>
>> :dataset ja:namedGraph
>> [
>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]][http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]]> ;
>> ja:graph
>> [
>> a tdb2:GraphTDB2 ;
>> tdb2:location "/path/to/dataset2/" ;
>> ]
>> ] .
>> ======================================================================
>>
>> I get this error when I try to query it:
>>
>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]]>
>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>> at arq.query.getDataset(query.java:176)
>> at arq.query.queryExec(query.java:213)
>> at arq.query.exec(query.java:153)
>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>> at tdb2.tdbquery.main(tdbquery.java:30)
>
 

Re: DatasetTDB2 with separate namedGraphs

Posted by Laura Morales <la...@mail.com>.
Andy: is this possible?
 
 

Sent: Sunday, November 11, 2018 at 4:32 PM
From: ajs6f <aj...@apache.org>
To: users@jena.apache.org
Subject: Re: DatasetTDB2 with separate namedGraphs
Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?

In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:

https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl

ajs6f

> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
>
> More or less, yes.
> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
> Then I'd like to query it like this: SELECT * FROM Graph1...
>
>
>
> Sent: Sunday, November 11, 2018 at 3:54 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
>
> ajs6f
>
>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>>
>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>>
>> ======================================================================
>> PREFIX fuseki: <http://jena.apache.org/fuseki#[http://jena.apache.org/fuseki#]>
>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#][http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]]>
>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#][http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]]>
>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#][http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]]>
>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#][http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]]>
>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#][http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]]>
>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#][http://jena.apache.org/text#[http://jena.apache.org/text#]]>
>>
>> :dataset a ja:RDFDataset .
>>
>> :dataset ja:namedGraph
>> [
>> ja:graphName <http://example.org/graph1[http://example.org/graph1][http://example.org/graph1[http://example.org/graph1]]> ;
>> ja:graph
>> [
>> a tdb2:GraphTDB2 ;
>> tdb2:location "/path/to/dataset1/" ;
>> ]
>> ] .
>>
>> :dataset ja:namedGraph
>> [
>> ja:graphName <http://example.org/graph2[http://example.org/graph2][http://example.org/graph2[http://example.org/graph2]]> ;
>> ja:graph
>> [
>> a tdb2:GraphTDB2 ;
>> tdb2:location "/path/to/dataset2/" ;
>> ]
>> ] .
>> ======================================================================
>>
>> I get this error when I try to query it:
>>
>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2][http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]]>
>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>> at arq.query.getDataset(query.java:176)
>> at arq.query.queryExec(query.java:213)
>> at arq.query.exec(query.java:153)
>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>> at tdb2.tdbquery.main(tdbquery.java:30)
>
 

Re: DatasetTDB2 with separate namedGraphs

Posted by ajs6f <aj...@apache.org>.
Andy can comment further, but I'm not sure that's possible. Is there some reason you don't just copy the graphs into one database?

In any event, what you have written down now as assembler RDF shows a tdb2:GraphTDB2 being declared with a tdb2:location and no name. I don't think that's correct. Here is an example that might be more on point:

https://github.com/apache/jena/blob/master/jena-db/jena-tdb2/testing/Assembler/tdb-named-graph-2.ttl

ajs6f

> On Nov 11, 2018, at 10:23 AM, Laura Morales <la...@mail.com> wrote:
> 
> More or less, yes.
> I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
> Then I'd like to query it like this: SELECT * FROM Graph1...
>  
>  
> 
> Sent: Sunday, November 11, 2018 at 3:54 PM
> From: ajs6f <aj...@apache.org>
> To: users@jena.apache.org
> Subject: Re: DatasetTDB2 with separate namedGraphs
> I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?
> 
> ajs6f
> 
>> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>> 
>> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>> 
>> ======================================================================
>> PREFIX fuseki: <http://jena.apache.org/fuseki#>
>> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]>
>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]>
>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]>
>> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]>
>> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]>
>> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#]>
>> 
>> :dataset a ja:RDFDataset .
>> 
>> :dataset ja:namedGraph
>> [
>> ja:graphName <http://example.org/graph1[http://example.org/graph1]> ;
>> ja:graph
>> [
>> a tdb2:GraphTDB2 ;
>> tdb2:location "/path/to/dataset1/" ;
>> ]
>> ] .
>> 
>> :dataset ja:namedGraph
>> [
>> ja:graphName <http://example.org/graph2[http://example.org/graph2]> ;
>> ja:graph
>> [
>> a tdb2:GraphTDB2 ;
>> tdb2:location "/path/to/dataset2/" ;
>> ]
>> ] .
>> ======================================================================
>> 
>> I get this error when I try to query it:
>> 
>> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]>
>> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
>> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
>> at arq.query.getDataset(query.java:176)
>> at arq.query.queryExec(query.java:213)
>> at arq.query.exec(query.java:153)
>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>> at tdb2.tdbquery.main(tdbquery.java:30)
>  


Re: DatasetTDB2 with separate namedGraphs

Posted by Laura Morales <la...@mail.com>.
More or less, yes.
I want 2 separate TDB2 databases, each one containing 1 graph. And I want a dataset that is defined by using those graphs from the separate databases. So, the dataset should have a graph called Graph1 located at ~/graph1 and another graph called Graph2 located at ~/graph2.
Then I'd like to query it like this: SELECT * FROM Graph1...
 
 

Sent: Sunday, November 11, 2018 at 3:54 PM
From: ajs6f <aj...@apache.org>
To: users@jena.apache.org
Subject: Re: DatasetTDB2 with separate namedGraphs
I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?

ajs6f

> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
>
> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
>
> ======================================================================
> PREFIX fuseki: <http://jena.apache.org/fuseki#>
> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#[http://jena.hpl.hp.com/2005/11/Assembler#]>
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#[http://www.w3.org/1999/02/22-rdf-syntax-ns#]>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#[http://www.w3.org/2000/01/rdf-schema#]>
> PREFIX tdb: <http://jena.hpl.hp.com/2008/tdb#[http://jena.hpl.hp.com/2008/tdb#]>
> PREFIX tdb2: <http://jena.apache.org/2016/tdb#[http://jena.apache.org/2016/tdb#]>
> PREFIX text: <http://jena.apache.org/text#[http://jena.apache.org/text#]>
>
> :dataset a ja:RDFDataset .
>
> :dataset ja:namedGraph
> [
> ja:graphName <http://example.org/graph1[http://example.org/graph1]> ;
> ja:graph
> [
> a tdb2:GraphTDB2 ;
> tdb2:location "/path/to/dataset1/" ;
> ]
> ] .
>
> :dataset ja:namedGraph
> [
> ja:graphName <http://example.org/graph2[http://example.org/graph2]> ;
> ja:graph
> [
> a tdb2:GraphTDB2 ;
> tdb2:location "/path/to/dataset2/" ;
> ]
> ] .
> ======================================================================
>
> I get this error when I try to query it:
>
> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2[http://jena.apache.org/2016/tdb#DatasetTDB2]>
> at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
> at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
> at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
> at arq.query.getDataset(query.java:176)
> at arq.query.queryExec(query.java:213)
> at arq.query.exec(query.java:153)
> at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
> at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
> at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
> at tdb2.tdbquery.main(tdbquery.java:30)
 

Re: DatasetTDB2 with separate namedGraphs

Posted by ajs6f <aj...@apache.org>.
I'm not quite sure what you're trying to do here-- are you trying to extract one named graph from one TDB2 database, another named graph from another TDB2 database, and present them via Fuseki as a single dataset?

ajs6f

> On Nov 11, 2018, at 9:49 AM, Laura Morales <la...@mail.com> wrote:
> 
> Can somebody please help me with configuring an assembler file for DatasetTDB2 with multiple namedGraphs in separate files? I have this configuration but it doesn't work
> 
> ======================================================================
> PREFIX fuseki:  <http://jena.apache.org/fuseki#>
> PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>
> PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
> PREFIX tdb:     <http://jena.hpl.hp.com/2008/tdb#>
> PREFIX tdb2:    <http://jena.apache.org/2016/tdb#>
> PREFIX text:    <http://jena.apache.org/text#>
> 
> :dataset a ja:RDFDataset .
> 
> :dataset ja:namedGraph
> [
>    ja:graphName <http://example.org/graph1> ;
>    ja:graph
>    [
>        a tdb2:GraphTDB2 ;
>        tdb2:location "/path/to/dataset1/" ;
>    ]
> ] .
> 
> :dataset ja:namedGraph
> [
>    ja:graphName <http://example.org/graph2> ;
>    ja:graph
>    [
>        a tdb2:GraphTDB2 ;
>        tdb2:location "/path/to/dataset2/" ;
>    ]
> ] .
> ======================================================================
> 
> I get this error when I try to query it:
> 
> org.apache.jena.sparql.ARQException: No such type: <http://jena.apache.org/2016/tdb#DatasetTDB2>
> 	at org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
> 	at tdb2.cmdline.ModTDBDataset.createDataset(ModTDBDataset.java:82)
> 	at arq.cmdline.ModDataset.getDataset(ModDataset.java:36)
> 	at arq.query.getDataset(query.java:176)
> 	at arq.query.queryExec(query.java:213)
> 	at arq.query.exec(query.java:153)
> 	at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
> 	at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
> 	at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
> 	at tdb2.tdbquery.main(tdbquery.java:30)