Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hdt-jena not usable with Lucene in Fuseki? #75

Open
bjonnh opened this issue Jul 31, 2018 · 0 comments
Open

Hdt-jena not usable with Lucene in Fuseki? #75

bjonnh opened this issue Jul 31, 2018 · 0 comments
Labels
deferred enhancement fuseki2 Issues regarding Fuseki 2 integration

Comments

@bjonnh
Copy link

bjonnh commented Jul 31, 2018

I am loading a dataset made of a graph indexed with lucene (graphb) and another graph (grapha).
I tried to use an HDT file to replace grapha (grapha_hdt).

But as soon as I load the grapha_hdt, Lucene queries stop working on graphb.

Even if I create a HDT dataset on another service, Lucene queries stops working.

As soon as I remove the HDT-only dataset or the HDT-graph from my combined dataset, Lucene queries work again.

I am using Fuseki 3.8.0 (and updated pom.xml accordingly).

There are no errors logged and I can query the HDT graph properly, as well as the Lucene-backed graph.

I'm guessing that HDTgraph doesn't really like to be in a text dataset. But it doesn't work even when it is in a separate service.

I don't know how I could query my grapha and graphb differently (I use both in my queries, looking for things from grapha into graphb)

@prefix :        <#> .
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb2:     <http://jena.apache.org/2016/tdb#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix text:    <http://jena.apache.org/text#> .
@prefix hdt: <http://www.rdfhdt.org/fuseki#> .

hdt:HDTGraph rdfs:subClassOf ja:Graph .

tdb2:DatasetTDB2  rdfs:subClassOf  ja:RDFDataset .

[] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
[] ja:loadClass "org.rdfhdt.hdtjena.HDTGraphAssembler" .

text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .

<#mixed> rdf:type fuseki:Service ;
    rdfs:label                      "mixed" ;
    fuseki:name                     "mixed" ;
    fuseki:serviceQuery             "query" ;
    fuseki:serviceQuery             "sparql" ;
    fuseki:serviceReadGraphStore       "get" ;
    fuseki:dataset           :indexed_textset ;    
    .


:indexed_textset rdf:type     text:TextDataset ;
    text:dataset   :mixed_dataset ;
    text:index     <#indexLucene> ;
    tdb2:unionDefaultGraph true ;
    .

:grapha a tdb2:GraphTDB2;
   tdb2:location "DB1" .


:grapha_hdt rdfs:label "RDF Graph1 from HDT file" ;
        rdf:type hdt:HDTGraph ;
	hdt:fileName "grapha.hdt" .
	
:graphb a tdb2:GraphTDB2;
  tdb2:location "DB2" .


:mixed_dataset a ja:RDFDataset;
	  ja:namedGraph
		[ ja:graphName <http://grapha>;
# Switching to grapha make it work
#		  ja:graph :grapha ; ];
		  ja:graph :grapha_hdt ; ];
  	  ja:namedGraph
		[ ja:graphName <http://graphb>;
		  ja:graph :graphb ; ];
	  tdb2:unionDefaultGraph true;
	  .


# Text index description
<#indexLucene> a text:TextIndexLucene ;
    text:directory <file:DB2_index> ;
    text:entityMap <#entMap> ;
    text:storeValues true ; 
    text:analyzer [ a text:StandardAnalyzer ] ;
    text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
    text:queryParser text:AnalyzingQueryParser ;
    text:multilingualSupport true ;
 .


<#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 ]
         ) .

@mielvds mielvds added this to the 3.0.0 milestone Jan 13, 2022
@mielvds mielvds removed this from the 3.0.0 milestone Feb 16, 2022
@mielvds mielvds added deferred enhancement fuseki2 Issues regarding Fuseki 2 integration labels Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deferred enhancement fuseki2 Issues regarding Fuseki 2 integration
Projects
None yet
Development

No branches or pull requests

2 participants