Re: read-only Fuseki TDB2

2023-09-19 Thread Andy Seaborne
While in TDB2, read-transactions never write, there is a case where a 
read-only setup needs to do writes.


It happens only at start-up and only the first time after the database 
is written during setup.


If there is a journal file with outstanding changes, these are completed 
before the database is passed to the application. It means there was an 
abnormal termination during the last write transaction after the commit 
point. The timing window for that is quite small.


A simple way is to prepare a database is to do a query on it as a 
separate process after it's been written : e.g.

tdb2.tdbquery --loc DATABASE 'ASK{}'

TDB1 is different; read-transactions can do some completion actions. The 
journal is more heavily used.


Andy

On 18/09/2023 16:35, Jim Balhoff wrote:

On Sep 18, 2023, at 11:09 AM, Andy Seaborne  wrote:



On 18/09/2023 15:35, Jim Balhoff wrote:

Thanks, I think that’s basically what I’ve got. The only operation I have 
enabled is 'fuseki:query’. But Fuseki still complains if the filesystem is 
read-only.


The database is opened before the configuration is processed.

Also, there is only one "database" java object for each database location and 
something elsewhere may now or later open it for other operations.

This could be changed - file management is (should be!) centralized in the 
codebase.

   


Got it, thanks. It isn’t too big of a problem; it would just be convenient for 
some situations like scaling up multiple servers in Kubernetes.



Re: read-only Fuseki TDB2

2023-09-18 Thread Jim Balhoff
> On Sep 18, 2023, at 11:09 AM, Andy Seaborne  wrote:
> 
> 
> 
> On 18/09/2023 15:35, Jim Balhoff wrote:
>> Thanks, I think that’s basically what I’ve got. The only operation I have 
>> enabled is 'fuseki:query’. But Fuseki still complains if the filesystem is 
>> read-only.
> 
> The database is opened before the configuration is processed.
> 
> Also, there is only one "database" java object for each database location and 
> something elsewhere may now or later open it for other operations.
> 
> This could be changed - file management is (should be!) centralized in the 
> codebase.
> 
>   

Got it, thanks. It isn’t too big of a problem; it would just be convenient for 
some situations like scaling up multiple servers in Kubernetes.



Re: read-only Fuseki TDB2

2023-09-18 Thread Andy Seaborne




On 18/09/2023 15:35, Jim Balhoff wrote:

Thanks, I think that’s basically what I’ve got. The only operation I have 
enabled is 'fuseki:query’. But Fuseki still complains if the filesystem is 
read-only.


The database is opened before the configuration is processed.

Also, there is only one "database" java object for each database 
location and something elsewhere may now or later open it for other 
operations.


This could be changed - file management is (should be!) centralized in 
the codebase.


Andy






On Sep 18, 2023, at 10:03 AM, Martynas Jusevičius  
wrote:

This looks like the configuration that you need:
https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html#read-only-service

On Mon, Sep 18, 2023 at 2:43 PM Jim Balhoff  wrote:


Hi,

Is it possible to run a Fuseki server using a read-only TDB2 directory? I’d 
like to run a query-only SPARQL endpoint, no updates. However I get an 
exception at startup if the filesystem is read-only. Does Fuseki need to 
acquire the lock even if updates are turned off?

Thank you,
Jim





Re: read-only Fuseki TDB2

2023-09-18 Thread Jim Balhoff
Thanks, I think that’s basically what I’ve got. The only operation I have 
enabled is 'fuseki:query’. But Fuseki still complains if the filesystem is 
read-only.

> On Sep 18, 2023, at 10:03 AM, Martynas Jusevičius  
> wrote:
> 
> This looks like the configuration that you need:
> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html#read-only-service
> 
> On Mon, Sep 18, 2023 at 2:43 PM Jim Balhoff  wrote:
>> 
>> Hi,
>> 
>> Is it possible to run a Fuseki server using a read-only TDB2 directory? I’d 
>> like to run a query-only SPARQL endpoint, no updates. However I get an 
>> exception at startup if the filesystem is read-only. Does Fuseki need to 
>> acquire the lock even if updates are turned off?
>> 
>> Thank you,
>> Jim
>> 



Re: read-only Fuseki TDB2

2023-09-18 Thread Martynas Jusevičius
This looks like the configuration that you need:
https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html#read-only-service

On Mon, Sep 18, 2023 at 2:43 PM Jim Balhoff  wrote:
>
> Hi,
>
> Is it possible to run a Fuseki server using a read-only TDB2 directory? I’d 
> like to run a query-only SPARQL endpoint, no updates. However I get an 
> exception at startup if the filesystem is read-only. Does Fuseki need to 
> acquire the lock even if updates are turned off?
>
> Thank you,
> Jim
>


Re: read-only Fuseki TDB2

2023-09-18 Thread Andy Seaborne

The TDB2 database is open for general use (i.e. write).

You can get read-only by restricting the operations on the dataset to 
only query and the read functions of the Graph Store Protocol.


Being SPARQL, query operations and write (update) operations are 
separate by syntax and there are different parsers for each subset of 
the total SPARQL grammar.


Andy

On 18/09/2023 13:40, Jim Balhoff wrote:

Hi,

Is it possible to run a Fuseki server using a read-only TDB2 directory? I’d 
like to run a query-only SPARQL endpoint, no updates. However I get an 
exception at startup if the filesystem is read-only. Does Fuseki need to 
acquire the lock even if updates are turned off?

Thank you,
Jim



Re: read-only Fuseki TDB2

2023-09-18 Thread Pedro
I think it depends more on query than with the back end, but don't have
detailed comparisons. Perhaps others do.

On Mon, 18 Sept 2023, 14:43 Jim Balhoff,  wrote:

> Thanks, maybe that would be a good fit. Do you know how query performance
> compares running over HDT compared to TDB2? Or is that question is too
> dependent on the particular queries to answer?
>
> > On Sep 18, 2023, at 8:51 AM, Pedro 
> wrote:
> >
> > Jim
> > Perhaps https://www.rdfhdt.org/manual-of-hdt-integration-with-jena/ will
> > suit your need.
> > Cheers
> > Peter
> >
> > On Mon, 18 Sept 2023, 13:43 Jim Balhoff,  wrote:
> >
> >> Hi,
> >>
> >> Is it possible to run a Fuseki server using a read-only TDB2 directory?
> >> I’d like to run a query-only SPARQL endpoint, no updates. However I get
> an
> >> exception at startup if the filesystem is read-only. Does Fuseki need to
> >> acquire the lock even if updates are turned off?
> >>
> >> Thank you,
> >> Jim
> >>
> >>
>
>


Re: read-only Fuseki TDB2

2023-09-18 Thread Jim Balhoff
Thanks, maybe that would be a good fit. Do you know how query performance 
compares running over HDT compared to TDB2? Or is that question is too 
dependent on the particular queries to answer?

> On Sep 18, 2023, at 8:51 AM, Pedro  
> wrote:
> 
> Jim
> Perhaps https://www.rdfhdt.org/manual-of-hdt-integration-with-jena/ will
> suit your need.
> Cheers
> Peter
> 
> On Mon, 18 Sept 2023, 13:43 Jim Balhoff,  wrote:
> 
>> Hi,
>> 
>> Is it possible to run a Fuseki server using a read-only TDB2 directory?
>> I’d like to run a query-only SPARQL endpoint, no updates. However I get an
>> exception at startup if the filesystem is read-only. Does Fuseki need to
>> acquire the lock even if updates are turned off?
>> 
>> Thank you,
>> Jim
>> 
>> 



Re: read-only Fuseki TDB2

2023-09-18 Thread Pedro
Jim
Perhaps https://www.rdfhdt.org/manual-of-hdt-integration-with-jena/ will
suit your need.
Cheers
Peter

On Mon, 18 Sept 2023, 13:43 Jim Balhoff,  wrote:

> Hi,
>
> Is it possible to run a Fuseki server using a read-only TDB2 directory?
> I’d like to run a query-only SPARQL endpoint, no updates. However I get an
> exception at startup if the filesystem is read-only. Does Fuseki need to
> acquire the lock even if updates are turned off?
>
> Thank you,
> Jim
>
>


read-only Fuseki TDB2

2023-09-18 Thread Jim Balhoff
Hi,

Is it possible to run a Fuseki server using a read-only TDB2 directory? I’d 
like to run a query-only SPARQL endpoint, no updates. However I get an 
exception at startup if the filesystem is read-only. Does Fuseki need to 
acquire the lock even if updates are turned off?

Thank you,
Jim