Skip to content

qEndpoint Full Text Indexing

Antoine Willerval edited this page Jan 23, 2023 · 9 revisions

In qEndpoint, you can configure into the repo_model.ttl file an index to enable full-text or GeoSPARQL indexing

You have multiple example of model here, but we will describe how to add a simple node to handle this.

Simple text indexing

You can describe a simple node do text indexing like this one:

# Specify the main node
mdlc:main mdlc:node _:mainNode .
_:mainNode mdlc:type mdlc:luceneNode ;
            # Describe the location of the lucene directory, you can use mdlc:parsedString for template strings
            mdlc:dirLocation "${locationNative}lucene"^^mdlc:parsedString ;
            # Define the reindex query for the lucene sail, the query should be ordered by ?s
            mdlc:luceneReindexQuery "SELECT * {?s ?p ?o} order by ?s" ;
            # Describe the evaluation mode of the queries, for native or endpointStore storage, use NATIVE
            mdlc:luceneEvalMode "NATIVE"^^mdlc:parsedString.

For location on disk, you can use the predefined options like locationNative for example, you can use all the predefined options here

You can then search with the search virtual properties in your SPARQL queries:

PREFIX search: <http://www.openrdf.org/contrib/lucenesail#>

?subj search:matches [
	      search:query "search terms...";
	      search:property my:property;
	      search:score ?score;
	      search:snippet ?snippet ] .
Clone this wiki locally