You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by se...@conjecto.com on 2012/11/05 18:03:09 UTC

Fuseki and Jena API

i use fuseki 0.2.5 and Jena 2.7.4

My TDB files are new i just created them for the test

I run Fuseki with this config

    rdfs:label                      "TDB Service (RW)" ;
    fuseki:name                     "myfirm" ;
    fuseki:serviceQuery             "query" ;
    fuseki:serviceQuery             "sparql" ;
    fuseki:serviceUpdate            "update" ;
    fuseki:serviceUpload            "upload" ;
    fuseki:serviceReadWriteGraphStore      "data" ;
    # A separate read-only graph store endpoint:
    fuseki:serviceReadGraphStore       "get" ;
    fuseki:dataset           <#dataset> ;


and i do an insert data in java with jena tdb api like :

	Dataset dataset = TDBFactory.createDataset(directory) ;
        Model modelGraph = dataset.getDefaultModel();
        dataset.begin(ReadWrite.WRITE);
        {
            ...
            
modelGraph.add(modelGraph.createResource(newUri),REPONSEA,modelGraph.createResource(uri));
            modelGraph.commit();
            dataset.commit();
            modelGraph.close();
         }
         finaly
         {
            dataset.end();
         }


My issue is that when i do a SPARQL req in fuseki like Select * {?s ?p 
?o} no uri in s collumn appears. I have to reboot fuseki to have 
something in my s collumn.

Serwan


Re: Fuseki and Jena API

Posted by se...@conjecto.com.
Ok, 

Thanks for the quick reply. I was suspecting something like that but
because we can do multithread with Jena API i was hoping transactionnal
could handle this. No way because this is not the same JVM.

Sorry for the "nooby" ask, I'll use the SPARQL endpoint in Java.

Regards.

Serwan


On Mon, 05 Nov 2012 21:50:06 +0000, Andy Seaborne <an...@apache.org>
wrote:
> On 05/11/12 17:03, serwan@conjecto.com wrote:
>> i use fuseki 0.2.5 and Jena 2.7.4
>>
>> My TDB files are new i just created them for the test
>>
>> I run Fuseki with this config
>>
>>     rdfs:label                      "TDB Service (RW)" ;
>>     fuseki:name                     "myfirm" ;
>>     fuseki:serviceQuery             "query" ;
>>     fuseki:serviceQuery             "sparql" ;
>>     fuseki:serviceUpdate            "update" ;
>>     fuseki:serviceUpload            "upload" ;
>>     fuseki:serviceReadWriteGraphStore      "data" ;
>>     # A separate read-only graph store endpoint:
>>     fuseki:serviceReadGraphStore       "get" ;
>>     fuseki:dataset           <#dataset> ;
>>
>>
>> and i do an insert data in java with jena tdb api like :
>>
>>      Dataset dataset = TDBFactory.createDataset(directory) ;
> 
> I hope you are not connecting to the database while Fuskei is
> running. Chaos, and a corrupted databse, will result.
> 
> Only one JVM can control the DB at a time.
> 
>>         Model modelGraph = dataset.getDefaultModel();
>>         dataset.begin(ReadWrite.WRITE);
>>         {
>>             ...
>> modelGraph.add(modelGraph.createResource(newUri),REPONSEA,modelGraph.createResource(uri));
>>
>>             modelGraph.commit();
>>             dataset.commit();
>>             modelGraph.close();
>>          }
>>          finaly
>>          {
>>             dataset.end();
>>          }
> 
> Either stop fuseki, update the database directly, exit program and
> restart fuseki or put the data in through Fuseki's web interfaces
> (SPARQL Update, SPARQL Graph Store Protocol)
> 
>>
>>
>> My issue is that when i do a SPARQL req in fuseki like Select * {?s ?p
>> ?o} no uri in s collumn appears. I have to reboot fuseki to have
>> something in my s collumn.
>>
>> Serwan
>>


Re: Fuseki and Jena API

Posted by Andy Seaborne <an...@apache.org>.
On 05/11/12 17:03, serwan@conjecto.com wrote:
> i use fuseki 0.2.5 and Jena 2.7.4
>
> My TDB files are new i just created them for the test
>
> I run Fuseki with this config
>
>     rdfs:label                      "TDB Service (RW)" ;
>     fuseki:name                     "myfirm" ;
>     fuseki:serviceQuery             "query" ;
>     fuseki:serviceQuery             "sparql" ;
>     fuseki:serviceUpdate            "update" ;
>     fuseki:serviceUpload            "upload" ;
>     fuseki:serviceReadWriteGraphStore      "data" ;
>     # A separate read-only graph store endpoint:
>     fuseki:serviceReadGraphStore       "get" ;
>     fuseki:dataset           <#dataset> ;
>
>
> and i do an insert data in java with jena tdb api like :
>
>      Dataset dataset = TDBFactory.createDataset(directory) ;

I hope you are not connecting to the database while Fuskei is running. 
Chaos, and a corrupted databse, will result.

Only one JVM can control the DB at a time.

>         Model modelGraph = dataset.getDefaultModel();
>         dataset.begin(ReadWrite.WRITE);
>         {
>             ...
> modelGraph.add(modelGraph.createResource(newUri),REPONSEA,modelGraph.createResource(uri));
>
>             modelGraph.commit();
>             dataset.commit();
>             modelGraph.close();
>          }
>          finaly
>          {
>             dataset.end();
>          }

Either stop fuseki, update the database directly, exit program and 
restart fuseki or put the data in through Fuseki's web interfaces 
(SPARQL Update, SPARQL Graph Store Protocol)

>
>
> My issue is that when i do a SPARQL req in fuseki like Select * {?s ?p
> ?o} no uri in s collumn appears. I have to reboot fuseki to have
> something in my s collumn.
>
> Serwan
>