Hello,

I have an existing (persisted) TDB and I’m starting Fuseki like this:

            Location location = Location.create("tdb");
            ds = TDBFactory.createDataset(location);
            FusekiServer fs = FusekiServer.create()
                    .add("/ds", ds)
                    .build();
            fs.start();

I want to create a (persisted) index from it for specific subject like this:

        EntityDefinition entDef = new EntityDefinition("uri", "text", "graph") ;
        Resource res = ResourceFactory.createProperty(“http:/ao.com/name”);
        entDef.setPrimaryPredicate(res);
        Path path = Paths.get("lucene_index");
        Directory dir = FSDirectory.open(path);
        ds = TextDatasetFactory.createLucene(ds, dir, entDef, null);

So, the code looks like this:

        Location location = Location.create("tdb");
        ds = TDBFactory.createDataset(location);

        EntityDefinition entDef = new EntityDefinition("uri", "text", "graph") ;
        Resource res = ResourceFactory.createProperty(“http:/ao.com/name”);
        entDef.setPrimaryPredicate(res);
        Path path = Paths.get("lucene_index");
        Directory dir = FSDirectory.open(path);
        ds = TextDatasetFactory.createLucene(ds, dir, entDef, null);

        FusekiServer fs = FusekiServer.create()
                    .add("/ds", ds)
                    .build();
         fs.start();

and the dataset is getting loaded, but no index is getting created.

What am I doing wrong?

S.


Reply via email to