On 18/11/2020 09:44, Rob Vesse wrote:
Hey Folks

So I just merged the first pass at JENA-1987 today, this adds the requested 
/$/compact/<dataset> endpoint into the Fuseki Admin API when using the Fuseki 
WebApp packaging.

However, this is not available for the JAR packaging currently, partly due to 
security concerns and partly due to code structuring.  Therefore I wanted to 
kick off a discussion of how we could improve this in future iterations of this 
functionality.  I know that Andy mentioned he might have some thoughts on this 
and having spent a few days in the code I also have some thoughts to share.

The main barrier for this right now is that the relevant servlets for some 
admin operations (backup, compact etc) currently live in the jena-fuseki-webapp 
module and so can’t be referenced from the jena-fuseki-server.  So at a bare 
minimum we’d need to split out the admin servlets into their own module 
(jena-fuseki-admin perhaps?) that can then be re-used across the other modules. 
 I think this would be a good next step regardless of what else we want to do 
in future.

A secondary concern is the design of the current admin API, currently the Admin 
API [1] is server wide i.e. everything is under /$/ so if enabled it’s 
available for all users (subject to any security the user configures) and 
dataset level operations apply to all datasets.  What might be a more useful 
design would be the ability to enable relevant operations on a per dataset 
basis.  So you’d be able to have something like the following:

/ds/compact
/ds/backup

i.e. you allow dataset specific operations to be enabled on a per-dataset 
basis.  Likely this would be combined with additional Fuseki configuration e.g.

<#service1> rdf:type fuseki:Service ;
     fuseki:name   "ds" ;       # http://host:port/ds
     fuseki:endpoint [
          # SPARQL query service
         fuseki:operation fuseki:query ;
         fuseki:name "sparql"
     ] ;
    fuseki:endpoint [
       # Compaction
       fuseki:operation fuseki:compact ;
       fuseki:name "compact"
    ] ;
    fuseki:endpoint [
      # Backup
      fuseki:operation fuseki:backup ;
      fuseki:name "backup"
    ]
   fuseki:dataset  <#dataset> ;

So users could opt into the endpoints they wanted.

Thoughts, suggestions, comments?

Rob


/ds/compact
/ds/backup

Yes.

See my other message - with a file-based configuration /$/ is a a lot less important.

I think the file-layout based system is better for scripting administration and building servers, less UI centric. The idea of Fuseki-webapp REST(ish) interface means remote admin is custom; at best, overlay it on the file-layout based system.

A few things remain:
/$/ping
/$/metrics
/$/stats

but all the dataset create/delete controls are not there (we can ad it later if there is proven demand).

The only lost is that "backup" is that at the moment any dataset can be backed up at the moment.

But there again, "backup" isn't even necessary! It's "GET /dataset" (obviously the long running connection is not so pleasant as a background task).

ActionBackup.java
ActionBackupList.java
ActionCompact.java

can be in jena-fuseki-core:org.apache.jena.fuseki.ctl

    Andy

Reply via email to