Hi Andy,

Seems so, the updating was already enabled. It didn’t work for me, because I 
omitted something else.

Now it works.

On your questions. I’m configuring, starting and loading data into Fuseki, 
completely thru Java:

This is a configurarion code snippet:

    public static Dataset createEmptyDataset() {
        Dataset ds;
        if (inMemory) {
            ds = DatasetFactory.createTxnMem();
            LOGGER.info("Store type - in memory");
        } else {
            Location location = Location.create("tdb");
            ds = TDBFactory.createDataset(location);
            LOGGER.info("Store type - TDB");
        }
        return ds;
    }

this is how I load the data:

    private static boolean loadGraphT(Dataset ds, String sourceFileName) {
        String fileName = GRAPH_RES_FOLDER + sourceFileName;
        File f = new File(fileName);
        if (!f.exists()) return false;
        String graphName = 
FILE_TO_GRAPH_NAME.get(sourceFileName.split("\\.")[0]);
        ds.begin(ReadWrite.WRITE);
        Model model = ds.getNamedModel(graphName);
        FileManager.get().readModel(model, fileName);
        ds.commit();
        ds.end();
        LOGGER.info("Graph file " + sourceFileName + " - loaded");
        return true;
    }

and this is how I start the server:

    private static void startFuseki(Dataset ds) {
        FusekiEmbeddedServer server = FusekiEmbeddedServer.create()
                .add("/ds", ds)
                .build();
        server.start() ;
    }

Like I said, the INSERT/DELETE requests are working now (without changing the 
configuration), but anyway thanks for the response …

Regards,
Stefan




On 6/24/17, 1:43 AM, "Andy Seaborne" <[email protected]> wrote:

    
    
    On 24/06/17 01:46, Dimov, Stefan wrote:
    > Hello,
    > I have Fuseki/Jena and I configure it thru Java code (no config files).
    > Does anybody know, how I can enable Fuseki update (e.g. – allow SPARQL 
INSERT/DELETE requests) thru Java code?
    > 
    > S.
    > 
    
    Hi Stefan,
    
    It needs to have the right services added to the DataAccessPointRegistry 
    though the best way to do that is probably not directly (it is an 
    internal API really though quite stable).
    
    How are you configuring it in code and also which form of Fuseki?
    
    The embedded server has a builder and one option is whether a dataset is 
    updatable or not:
    
    http://jena.apache.org/documentation/fuseki2/fuseki-embedded.html
    
    which has no required disk footprint.
    
    or are you launching it by calling FusekiCmd.main (make sure "--update" 
    is used)
    
    or directly manipulating the DataAccessPointRegistry?
    (the command line
    
    (There'll be a command line for the embedded server soon - for running 
    Fuseki without admin.)
    
         Andy
    

Reply via email to