Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

The SparqlIndexer listens to the repository generated JMS events and index records to a the triplestore like Fuseki, Sesame etc. It implements the org.fcrepo.indexer.Indexer interface for the indexing functionalities, which consists of the methods to handle new/updated records and deleted records.

Once the SparqlIndexer configured to index the records to the triplestore, we can use the triplestore to perform external SPARQL searchings for SPARQL Recipeswith the SPARQL Recipes.

Info

The triplestore needs to be started before running the message consumer web app. Please follow the instructions to setup a triplestore.

Configuration

The SparqlIndexer is indexer is configured using Spring that , which can be done using through the Java bean setter methods.  Here is a sample configuration fragment showing how to configure and use itthe SparqlIndexer:

No Format
  <!-- Copy object RDF to a Fuseki triplestore using SPARQL Updatesparql-update indexer -->
  <bean id="sparqlUpdate" class="org.fcrepo.indexer.sparql.SparqlIndexer">
    <!-- base URL for triplestore subjects, PID will be appended --fuseki -->
    <property name="queryBase" value="http://${fuseki.host:localhost}:${fuseki.port:3030}/test/query"/>
    <property name="prefixupdateBase" value="http://${fuseki.host:localhost}:${testfuseki.port:80803030}/resttest/objects/"/>update"/>
    <property name="formUpdates">
      <value type="java.lang.Boolean">false</value>
    </property>
    <!-- sesame -->
    <!--
    <property name="queryBase" value="http://${sesame.host:localhost:3030}:${sesame.port:8081}/openrdf-sesame/repositories/test/query"/>
    <property name="updateBase" value="http://${sesame.host:localhost:3030}:${sesame.port:8081}/openrdf-sesame/repositories/test/updatestatements"/>
    <property name="formUpdates">
      <value type="java.lang.Boolean">false<>true</value>
    </property>
    -->
  </bean>
 
  <!-- Message MainDriven indexerPOJO class(MDP) that processesmanages events, gets RDF from the repository and calls the workersindividual indexers -->
  <bean id="indexerGroup" class="org.fcrepo.indexer.IndexerGroup">
    <constructor-arg name="repositoryURL" value="http://${fcrepo.host:localhost}:${fcrepo.port:8080}${fcrepo.context:/}rest" />
    <constructor-arg name="indexers">
      <set>
        ...
        <ref bean="sparqlUpdate"/>
        ...
      </set>
    </constructor-arg>
    ...
  </bean>