Blog do Fernando Meyer

ipsa scientia potestas est

Configuring Joseki + Pellet + TDB

View Comments

I was looking for some documentation about using TDB and Pellet
reasoser on Jena without pet peeves, didn’t found anything usable at all, so after a few
attempts I was still fighting against an ambiguity error,
whenever Joseki tries to build a dataset, the following exception pops up

18:18:49 WARN  Configuration        :: Failed to build dataset from
description (service name: reason): cannot find a most specific type
for file:///joseki-config.ttl#dataset_reason, which has as
possibilities: ja:RDFDataset ja:InfModel.
com.hp.hpl.jena.assembler.exceptions.AmbiguousSpecificTypeException:
cannot find a most specific type for file:///Users/fmeyer/projects/semantic/
servicos/joseki/joseki-config.ttl#dataset_reason, which has as possibilities: 
ja:RDFDataset ja:InfModel.
 at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.
 open(AssemblerGroup.java:104)
 at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.
 open(AssemblerGroup.java:70)
 at com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:41)
 at com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:38)
 at org.joseki.DatasetDesc.newDataset(DatasetDesc.java:65)
 at org.joseki.DatasetDesc.initialize(DatasetDesc.java:60)
 at org.joseki.Configuration.processModel(Configuration.java:112)
 at org.joseki.Configuration.(Configuration.java:83)
 at org.joseki.Dispatcher.setConfiguration(Dispatcher.java:130)
 at org.joseki.Dispatcher.initServiceRegistry(Dispatcher.java:100)
 at org.joseki.Dispatcher.initServiceRegistry(Dispatcher.java:93)
 at org.joseki.RDFServer.init(RDFServer.java:79)
 at org.joseki.RDFServer.(RDFServer.java:64)
 at joseki.rdfserver.main(rdfserver.java:85)

We just need to define a GraphTDB as a subclass of a Model as follow to fix this issue

@prefix ja:     <http ://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix tdb:     </http><http ://jena.hpl.hp.com/2008/tdb#> .
 
## Initialize TDB.
 
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .
 
## ---- A whole dadaset managed by TDB
< #dataset_reason> rdf:type      ja:RDFDataset ;
  ja:defaultGraph < #inf_graph> .
 
< #dataset> rdf:type      ja:RDFDataset ;
  ja:defaultGraph < #def_graph> ;
  .
 
< #inf_graph> rdf:type  ja:InfModel ;
    ja:reasoner [
        ja:reasonerClass
            "org.mindswap.pellet.jena.PelletReasonerFactory" ;
       ] ;
    ja:baseModel < #tdbGraph> .
 
< #def_graph> rdf:type  ja:InfModel ;
    ja:baseModel < #tdbGraph> .
 
< #tdbGraph> rdf:type tdb:GraphTDB ;
    tdb:location "DB" ;
    .
  • Facebook
  • Slashdot
  • WordPress
  • Digg
  • Posterous
  • Reddit
  • Tumblr
  • DZone
  • Google Bookmarks
  • Twitter
  • Google Gmail
  • Delicious
  • Google Reader
  • LinkedIn
  • Google Buzz
  • BibSonomy
  • Instapaper
  • Netvibes Share
  • Share/Bookmark

Written by fmeyer

August 27th, 2009 at 12:45 am

Posted in Sem categoria

blog comments powered by Disqus