You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Tim Harsch <ha...@yahoo.com> on 2013/10/25 19:56:33 UTC

jena-text assembler file not working for me


Hi all,
I was playing around with the new jena-text module.  I downloaded from svn the jena-2.11.0 tag and ran the JenaTextExample1 example.  It failed with the following error:
Exception in thread "main" org.apache.jena.riot.RiotNotFoundException: Not found: data.ttl

this was simple to fix as the issue was that there was no data.ttl file in the root of the jena-text module.   So I created one that looks like so:
@prefix :        <http://localhost/jena_example/#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
:T1 rdfs:label "X0 X1 X2" .
:T2 rdfs:label "X10 X11 X12" .


I then ran it again to get the following result:
----------------------------------------------------
| s                                   | label      |
====================================================
| <http://localhost/jena_example/#T1> | "X0 X1 X2" |
----------------------------------------------------

Now I simply changed lines 46-47 from:
        Dataset ds = createCode() ;
        //Dataset ds = createAssembler() ;

to:
        //Dataset ds = createCode() ;
        Dataset ds = createAssembler() ;

and run it again to get:
-------------
| s | label |
=============
-------------

I looked at the assemble file and don't really see any issues with it.  It should just be creating a DatasetTDB for the dataset, rather than the createCode() method's choice to build a dataset via DatasetFactory.createMem()

Any help appreciated.

Thanks,
Tim


Re: jena-text assembler file not working for me

Posted by Andy Seaborne <an...@apache.org>.
On 28/10/13 18:21, Tim Harsch wrote:
> Thanks Andy,
> I didn't think to look at that, because apparently I misunderstood unionDefaultGraph. I thought it was analagous to Allegrograph which treats the default graph as a union of all graphs (default + named).
> According to: http://jena.apache.org/documentation/tdb/assembler.html#union-default-graph
> "An assembler can specify that the default graph for query is the union of the named graphs. "
>
> So does that mean that when data, with triples in the unnamed graph, is loaded into the dataset it is discarded?  Or is it retained in a default graph which is just inaccessible by query?

The latter - they go in to the (real) default graph.

unionDefaultGraph is an artifact of query processing.

	Andy

>
>
>
>> On Saturday, October 26, 2013 9:21 AM, Andy Seaborne <an...@apache.org> wrote:
>>> T im,
>>
>> The assembler file has
>>
>>       tdb:unionDefaultGraph true ;
>>
>> in it; no idea why.  The real default graph is loaded with the example data.
>>
>> The example query uses
>>       ?s text:query (rdfs:label 'X1') ;
>>          rdfs:label ?label
>>
>> so it is accessing the default graph at rdfs:label -- no matches, no
>> results.
>>
>> Remove the tdb:unionDefaultGraph - also try with out the rdfs:label to
>> show the index does return something.
>>
>>      Andy
>>
>>
>>
>>
>> On 25/10/13 18:56, Tim Harsch wrote:
>>>
>>>
>>>   Hi all,
>>>   I was playing around with the new jena-text module.  I downloaded from svn
>> the jena-2.11.0 tag and ran the JenaTextExample1 example.  It failed with the
>> following error:
>>>   Exception in thread "main"
>> org.apache.jena.riot.RiotNotFoundException: Not found: data.ttl
>>>
>>>   this was simple to fix as the issue was that there was no data.ttl file in
>> the root of the jena-text module.   So I created one that looks like so:
>>>   @prefix :        <http://localhost/jena_example/#> .
>>>   @prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
>>>   :T1 rdfs:label "X0 X1 X2" .
>>>   :T2 rdfs:label "X10 X11 X12" .
>>>
>>>
>>>   I then ran it again to get the following result:
>>>   ----------------------------------------------------
>>>   | s                                   | label      |
>>>   ====================================================
>>>   | <http://localhost/jena_example/#T1> | "X0 X1 X2" |
>>>   ----------------------------------------------------
>>>
>>>   Now I simply changed lines 46-47 from:
>>>            Dataset ds = createCode() ;
>>>            //Dataset ds = createAssembler() ;
>>>
>>>   to:
>>>            //Dataset ds = createCode() ;
>>>            Dataset ds = createAssembler() ;
>>>
>>>   and run it again to get:
>>>   -------------
>>>   | s | label |
>>>   =============
>>>   -------------
>>>
>>>   I looked at the assemble file and don't really see any issues with it.
>> It should just be creating a DatasetTDB for the dataset, rather than the
>> createCode() method's choice to build a dataset via
>> DatasetFactory.createMem()
>>>
>>>   Any help appreciated.
>>>
>>>   Thanks,
>>>   Tim
>>>
>>


Re: jena-text assembler file not working for me

Posted by Tim Harsch <ha...@yahoo.com>.
Thanks Andy,
I didn't think to look at that, because apparently I misunderstood unionDefaultGraph. I thought it was analagous to Allegrograph which treats the default graph as a union of all graphs (default + named).
According to: http://jena.apache.org/documentation/tdb/assembler.html#union-default-graph
"An assembler can specify that the default graph for query is the union of the named graphs. "

So does that mean that when data, with triples in the unnamed graph, is loaded into the dataset it is discarded?  Or is it retained in a default graph which is just inaccessible by query?



> On Saturday, October 26, 2013 9:21 AM, Andy Seaborne <an...@apache.org> wrote:
> >T im,
> 
> The assembler file has
> 
>      tdb:unionDefaultGraph true ;
> 
> in it; no idea why.  The real default graph is loaded with the example data.
> 
> The example query uses
>      ?s text:query (rdfs:label 'X1') ;
>         rdfs:label ?label
> 
> so it is accessing the default graph at rdfs:label -- no matches, no 
> results.
> 
> Remove the tdb:unionDefaultGraph - also try with out the rdfs:label to 
> show the index does return something.
> 
>     Andy
> 
> 
> 
> 
> On 25/10/13 18:56, Tim Harsch wrote:
>> 
>> 
>>  Hi all,
>>  I was playing around with the new jena-text module.  I downloaded from svn 
> the jena-2.11.0 tag and ran the JenaTextExample1 example.  It failed with the 
> following error:
>>  Exception in thread "main" 
> org.apache.jena.riot.RiotNotFoundException: Not found: data.ttl
>> 
>>  this was simple to fix as the issue was that there was no data.ttl file in 
> the root of the jena-text module.   So I created one that looks like so:
>>  @prefix :        <http://localhost/jena_example/#> .
>>  @prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
>>  :T1 rdfs:label "X0 X1 X2" .
>>  :T2 rdfs:label "X10 X11 X12" .
>> 
>> 
>>  I then ran it again to get the following result:
>>  ----------------------------------------------------
>>  | s                                   | label      |
>>  ====================================================
>>  | <http://localhost/jena_example/#T1> | "X0 X1 X2" |
>>  ----------------------------------------------------
>> 
>>  Now I simply changed lines 46-47 from:
>>           Dataset ds = createCode() ;
>>           //Dataset ds = createAssembler() ;
>> 
>>  to:
>>           //Dataset ds = createCode() ;
>>           Dataset ds = createAssembler() ;
>> 
>>  and run it again to get:
>>  -------------
>>  | s | label |
>>  =============
>>  -------------
>> 
>>  I looked at the assemble file and don't really see any issues with it.  
> It should just be creating a DatasetTDB for the dataset, rather than the 
> createCode() method's choice to build a dataset via 
> DatasetFactory.createMem()
>> 
>>  Any help appreciated.
>> 
>>  Thanks,
>>  Tim
>> 
> 

Re: jena-text assembler file not working for me

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

The assembler file has

     tdb:unionDefaultGraph true ;

in it; no idea why.  The real default graph is loaded with the example data.

The example query uses
     ?s text:query (rdfs:label 'X1') ;
        rdfs:label ?label

so it is accessing the default graph at rdfs:label -- no matches, no 
results.

Remove the tdb:unionDefaultGraph - also try with out the rdfs:label to 
show the index does return something.

	Andy



On 25/10/13 18:56, Tim Harsch wrote:
>
>
> Hi all,
> I was playing around with the new jena-text module.  I downloaded from svn the jena-2.11.0 tag and ran the JenaTextExample1 example.  It failed with the following error:
> Exception in thread "main" org.apache.jena.riot.RiotNotFoundException: Not found: data.ttl
>
> this was simple to fix as the issue was that there was no data.ttl file in the root of the jena-text module.   So I created one that looks like so:
> @prefix :        <http://localhost/jena_example/#> .
> @prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
> :T1 rdfs:label "X0 X1 X2" .
> :T2 rdfs:label "X10 X11 X12" .
>
>
> I then ran it again to get the following result:
> ----------------------------------------------------
> | s                                   | label      |
> ====================================================
> | <http://localhost/jena_example/#T1> | "X0 X1 X2" |
> ----------------------------------------------------
>
> Now I simply changed lines 46-47 from:
>          Dataset ds = createCode() ;
>          //Dataset ds = createAssembler() ;
>
> to:
>          //Dataset ds = createCode() ;
>          Dataset ds = createAssembler() ;
>
> and run it again to get:
> -------------
> | s | label |
> =============
> -------------
>
> I looked at the assemble file and don't really see any issues with it.  It should just be creating a DatasetTDB for the dataset, rather than the createCode() method's choice to build a dataset via DatasetFactory.createMem()
>
> Any help appreciated.
>
> Thanks,
> Tim
>