Hi Johannes,

it is very likely you're missing some jars, take a look here http://jena.apache.org/download/maven.html

Regards,
Sorin


Am 25.05.2022 um 08:31 schrieb johannes.he...@mercedes-benz.com.INVALID:
Hi Sorin,

thanks for your fast reply. I already tried your suggestion as well as this one:

@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] ja:loadClass "com.hp.hpl.jena.tdb2.TDB2" .
tdb:DatasetTDB2  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

Both lead to the same error as described in the initial post 
(org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root 
https://km-ps.com/model/data/myDataset has no most specific type that is a 
subclass of ja:Object)

Best regards,
Johannes

-----Ursprüngliche Nachricht-----
Von: Sorin Gheorghiu <sorin.gheorg...@uni-konstanz.de>
Gesendet: Mittwoch, 25. Mai 2022 08:19
An: users@jena.apache.org
Betreff: Re: Indexing existing TDB2 dataset with assembler file

Hi,

it seems you missed to initialize TDB for ex.

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

Regards,
Sorin

Am 25.05.2022 um 08:03 schrieb johannes.he...@mercedes-benz.com.INVALID:
I have a TDB2 database with a dataset named "test". Via fuseki UI I can run 
SparQL queries without any problems. Now I want to index my dataset with the following 
command:

java -cp ./fuseki-server.jar jena.textindexer --desc=run/assembler.ttl

I get this error:

the root https://km-ps.com/model/data/myDataset has no most specific
type that is a subclass of ja:Object
doing: root: https://km-ps.com/model/data/mytextDataset with type:
http://jena.apache.org/text#TextDataset assembler class: class
org.apache.jena.query.text.assembler.TextDatasetAssembler

This is my assembler.ttl:

@prefix :        <https://km-ps.com/model/data/> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix kgdomain:<https://km-ps.com/model/domain#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb:     <http://jena.hpl.hp.com/2016/tdb#> .
@prefix text:    <http://jena.apache.org/text#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#>
@prefix fuseki:  <http://jena.apache.org/fuseki#> .

[] rdf:type fuseki:Server ;
      fuseki:services (
          :myservice
      ) .

:myservice rdf:type fuseki:Service ;
      fuseki:name                       "test" ;     # e.g : `s-query 
--service=http://localhost:3030/myds "select * ..."`
      fuseki:serviceQuery               "query" ;    # SPARQL query service
      fuseki:serviceUpdate              "update" ;   # SPARQL update service
      fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph store 
protocol (read and write)
      fuseki:dataset                    :mytextDataset ;
      .

## ---------------------------------------------------------------

# A TextDataset is a regular dataset with a text index.
:mytextDataset rdf:type     text:TextDataset ;
      text:dataset   :myDataset ; # <-- replace `:my_dataset` with the desired 
URI
      text:index     <#indexLucene> ;
.

# A TDB dataset used for RDF storage
:myDataset rdf:type      tdb:DatasetTDB2 ; # <-- replace `:my_dataset` with the 
desired URI - as above
      tdb:location "/fuseki/run/databases/test" ;
      # tdb:unionDefaultGraph true ; # Optional .

# Text index description
<#indexLucene> a text:TextIndexLucene ;
      text:directory <file:/fuseki/run/databases/test> ; # <file:path> ;  # <-- replace 
`<file:path>` with your path (e.g., `<file:/.../
      text:entityMap <#entMap> ;
      text:storeValues true ;
      text:analyzer [ a text:StandardAnalyzer ] ;
      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
      text:queryParser text:AnalyzingQueryParser ;
      text:multilingualSupport true ; # optional .

# Entity map (see documentation for other options) <#entMap> a
text:EntityMap ;
      text:defaultField     "label" ;
      text:entityField      "uri" ;
      text:uidField         "uid" ;
      text:langField        "lang" ;
      text:graphField       "graph" ;
      text:map (
          [ text:field "label" ;
          text:predicate rdfs:label ]
      ) .


Is there an easy solution to this problem? I would be thankful for any help.


If you are not the addressee, please inform us immediately that you have 
received this e-mail by mistake, and delete it. We thank you for your support.


If you are not the addressee, please inform us immediately that you have 
received this e-mail by mistake, and delete it. We thank you for your support.

--
Sorin Gheorghiu             Tel: +49 7531 88-3198
Universität Konstanz        Raum: B705
78464 Konstanz              sorin.gheorg...@uni-konstanz.de

- KIM: Abteilung IT-Dienste Forschung und Lehre -

Reply via email to