Hi Andy,

I have tested inserting and querying data using with two tdb
configs. Having "tdb:unionDefaultGraph true ;" in the config for read-only
endpoint
seems to affects the update endpoint.

*The queries I am using to insert data and query are:*

 PREFIX owl: <http://www.w3.org/2002/07/owl#>
 INSERT DATA {
     <http://localhost:3030/resource/Kevin> foaf:lastName "Fernando" .
    <http://localhost:3030/resource/Peter> foaf:lastName "Fernando" .
 }


PREFIX owl: <http://www.w3.org/2002/07/owl#>
select *
where {
 ?s ?p ?o .
}

I have tried the following tdb config with and without setting
tdb:unionDefaultGraph to true (in Fuseki web console against the dataset
"/data" which is my update endpoint). In both cases the insert data query
returns "Update succeeded" message. The select query, however, shown data
triples only when Fuseki
is run without setting tdb:unionDefaultGraph to true for READ-ONLY
endpoint. I am not useing that endpoint at all (but it is available). Note
they both use the same storage location "MYTDB".

*Here is the tdb config file:*

# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
## Example of a TDB dataset published using Fuseki: persistent storage.
@prefix :        <#> .
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@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 ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] rdf:type fuseki:Server ;
   # Timeout - server-wide default: milliseconds.
   # Format 1: "1000" -- 1 second timeout
   # Format 2: "10000,60000" -- 10s timeout to first result, then 60s
timeout to for rest of query.
   # See java doc for ARQ.queryTimeout
   # ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000" ] ;
   # ja:loadClass "your.code.Class" ;
   fuseki:services (
     <#service_tdb_read_only>
     <#service_tdb_all>
   ) .

# TDB
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .
## ---------------------------------------------------------------
## Read-only TDB dataset (only read services enabled).
<#service_tdb_read_only> rdf:type fuseki:Service ;
    rdfs:label                      "TDB Service (R)" ;
    fuseki:name                     "ds" ;             # http://host/ds
    fuseki:serviceQuery             "query" ;
    fuseki:serviceQuery             "sparql" ;
    # Don't allow SPARQL Update.
    #fuseki:serviceUpdate            "update" ;
    # Use the read-only service.
    fuseki:serviceReadGraphStore    "data" ;
    fuseki:serviceReadGraphStore    "get" ;
    fuseki:dataset           <#tdb_dataset_read> ;
    .

<#tdb_dataset_read> rdf:type      tdb:DatasetTDB ;
    tdb:location "MYTDB" ;
    tdb:unionDefaultGraph true ;  ##NOTE: I am trying with and without this
line
    .

## ---------------------------------------------------------------
## Updatable TDB dataset with all services enabled.
<#service_tdb_all> rdf:type fuseki:Service ;
    rdfs:label                      "TDB Service (RW)" ;
    fuseki:name                     "data" ;   # http://host/data
    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           <#tdb_dataset_readwrite> ;
    .

<#tdb_dataset_readwrite> rdf:type      tdb:DatasetTDB ;
    tdb:location "MYTDB" ;
     .





On 22 January 2014 12:00, Andy Seaborne <[email protected]> wrote:

> On 22/01/14 11:34, Rohana Rajapakse wrote:
>
>> Dear Andy,
>>
>> you are absolutely correct. There is "tdb:unionDefaultGraph true ." in the
>> config file for a different (read only) endpoint. It seems to affect the
>> entire datastore (not endpoint specific!)
>>
>
> It shouldn't - could you post the whole config file please ?
>
>         Andy
>
>
>> thanks
>>
>> Rohana
>>
>>
>> On 22 January 2014 11:18, Rohana Rajapakse <
>> [email protected]> wrote:
>>
>>    Yes it works!
>>>
>>> Can you please tell me what you mean by "running with default union graph
>>> on". I thought we always have a default graph, and if no named-graph is
>>> specified in sparql (update or select) queries, the operations are
>>> performed against the default graph, i.e. triples being inserted goes in
>>> the default graph and select queries return data in all graphs (including
>>> the default graph).
>>>
>>> How can use change default union graph to off?
>>>
>>> What exactly is the uri of the default graph?
>>>
>>> Thanks
>>>
>>> Rohana
>>>
>>>
>>> -----Original Message-----
>>> From: Andy Seaborne [mailto:[email protected] <[email protected]>]
>>> Sent: 22 January 2014 11:09
>>> To: [email protected]
>>> Subject: Re: Default graph issue (tdb-backed Fuseki)
>>>
>>> On 22/01/14 09:29, Rohana Rajapakse wrote:
>>>
>>>> Hi,
>>>>
>>>
>>> Hi there,
>>>
>>>
>>>>
>>>>
>>>> I have a tdb-backed Fuseki installation. I am  inserting data using
>>>> INSERT DATA sparql query (also tried reading triple data from a file)
>>>> without giving a named-graph uri (with GRAPH keyword),
>>>>
>>>
>>> Did you just use the UI or load the data some other way as well?
>>>
>>>  the query is executed
>>>> without errors and in the query forms of the Fuseki web console I see
>>>> the message “*Update succeeded*”, but a select query without giving a
>>>> named-graph (with GRAPH <…>) does not show the inserted triples.
>>>>
>>>
>>> Could you try this query please:
>>>
>>> SELECT ?s ?s1 ?s2  {
>>>     { ?s ?p ?o }
>>>     UNION
>>>     { GRAPH <urn:x-arq:DefaultGraph> { ?s1 ?p1 ?o1 } }
>>>     UNION
>>>     { GRAPH ?g2 { ?s2 ?p2 ?o2 } }
>>> }
>>>
>>> It looks like you are running with default union graph on - maybe it was
>>> set globally when the server was started.
>>>
>>>          Andy
>>>
>>>  It all works when I inserted data into a named-graph using the
>>>> GRAPH<…>
>>>>
>>>>
>>>>
>>>> Can someone please let me know what is going on.
>>>>
>>>>
>>>>
>>>> I am using Fuseki-1.0.0 with Jena-2.11.0
>>>>
>>>>
>>>>
>>>> Here is the TDB config file:
>>>>
>>>>
>>>>
>>>> <#service_tdb_all> rdf:type fuseki:Service ;
>>>>
>>>>       rdfs:label                      "TDB Service (RW)" ;
>>>>
>>>>       fuseki:name                     "data" ;
>>>>
>>>>       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           <#tdb_dataset_readwrite> ;
>>>>
>>>>       .
>>>>
>>>>
>>>>
>>>> <#tdb_dataset_readwrite> rdf:type      tdb:DatasetTDB ;
>>>>
>>>>       tdb:location "MYTDB" ;
>>>>
>>>>       .
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Thanks for any help.
>>>>
>>>>
>>>>
>>>> Rohana
>>>>
>>>>
>>>
>>>
>>> Keep up-to-date with best practice, new releases, webinars and more with
>>> our free newsletter:
>>> http://www.gossinteractive.com/newsletter
>>>
>>> Registered Office: 24 Darklake View, Estover, Plymouth, PL6 7TL.
>>>
>>> Company Registration No: 3553908
>>>
>>> This email contains proprietary information, some or all of which may be
>>> legally privileged. It is for the intended recipient only. If an
>>> addressing
>>> or transmission error has misdirected this email, please notify the
>>> author
>>> by replying to this email. If you are not the intended recipient you may
>>> not use, disclose, distribute, copy, print or rely on this email.
>>>
>>> Email transmission cannot be guaranteed to be secure or error free, as
>>> information may be intercepted, corrupted, lost, destroyed, arrive late
>>> or
>>> incomplete or contain viruses. This email and any files attached to it
>>> have
>>> been checked with virus detection software before transmission. You
>>> should
>>> nonetheless carry out your own virus check before opening any attachment.
>>> GOSS Interactive Ltd accepts no liability for any loss or damage that may
>>> be caused by software viruses.
>>>   <#143b9ad660b1e235_>
>>>
>>>
>>
>

Reply via email to