Thanks, Andy!

S.

On 10/19/17, 10:54 AM, "Andy Seaborne" <[email protected]> wrote:

    (sorry for the brief reply ... travelling)
    
    On 17/10/17 21:54, Dimov, Stefan wrote:
    > Hello,
    > 
    > I have an existing (persisted) TDB and I’m starting Fuseki like this:
    > 
    >              Location location = Location.create("tdb");
    >              ds = TDBFactory.createDataset(location);
    
    See TextDatasetFactory.create(Dataset base, TextIndex textIndex)
    
    and register that dataset built around the TDB one.
    
         Andy
    
    
    >              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