Hi Greg,

Just to check:
How are you running the server?
Is that assembler on the command line?


When Fuseki starts up it looks for datasets by rdf:type.

In your assembler below there is one dataset:

> #TDB dataset on disk.
> :tdb-dataset rdf:type tdb:DatasetTDB ;
>      tdb:location  "my_jena_tdb" .

and that is what Fuseki will find.

The rest of the assembler isn't connected to that.

You need two datasets - one to pull your graphs and inference together, and a subsidiary one to have the TDB storage.

Does this example help?



On 03/04/18 15:14, Greg Albiston wrote:

I'm trying to setup a TDB dataset that contains multiple named graphs which 
each use RDFS inferencing and a schema.
I've tried to follow the website documentation but there are several gaps on 
this topic.
For example, the RDFS section on 
https://jena.apache.org/documentation/tdb/assembler.html and the Inference 
section on 
https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html don't 
seem to contain complete information.

The objective is that when using the Jena API a single Dataset object can be 
retrieved to execute queries against. The queries themselves will specify the 
graph to be selected.

I've tried a variant on the below which runs without error. The schema file and 
TDB folder are both located in the root of the application folder. However, a 
test query on the dataset for the named graph provides asserted results but not 
RDFS inferencing. I've confirmed through debugging that the assembly file is 

Does a URI name need to be set for the inference model for referencing?
The below webpage has an example for Fuseki with persistent TDB and 
inferencing. It has a ja:RDFDataset that states the ja:defaultGraph as being 
the inference model. Is the same required for named graphs?

Any help would be much appreciated,


@prefix :      <http://example.org/my#> .
@prefix tdb:   <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja:    <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

[] ja:loadClass "org.apache.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model      .

This isn't necessary nowadays - it's harmless.

#TDB dataset on disk.
:tdb-dataset rdf:type tdb:DatasetTDB ;
     tdb:location  "my_jena_tdb" .

#Create a RDFS Factory as re-used.
:rdfsFactory rdf:type ja:ReasonerFactory;
     ja:reasonerURL <http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner>;
     ja:schema :myRDFS .

#RDFS Schema loaded as memory model.
:myRDFS rdf:type ja:MemoryModel ;
     ja:content [ja:externalContent <file:///my_schema.rdf>] .

#Specify named graph in the dataset.
:my-graph rdf:type tdb:GraphTDB ;
     tdb:dataset :tdb-dataset ;
     tdb:graphName <http://example.org#myGraph> .

#Inference model combining graph and reasoner.
:my-model-inf rdf:type ja:InfModel ;
     ja:baseModel :my-graph ;
     ja:reasoner :rdfsFactory.

Reply via email to