Skip to content
Andrea Gazzarini edited this page Apr 7, 2015 · 16 revisions

SolRDF (i.e. Solr + RDF) is a set of Solr extensions for managing (index and search) RDF data.

This page will guide you through the SolRDF quick installation.

If you already have Solr (4.8.x - 4.10.x) installed, please refer to this section for detailed instruction.

I assume you already have Java (7), Maven (3.x) and git on your system.

  1. Checkout the project Open a new shell and type the following:
# cd /tmp
# git clone https://github.com/agazzarini/SolRDF.git solrdf-download
  1. Build and run SolrRDF
# cd solrdf-download/solrdf
# mvn clean package cargo:run

The very first time you run this command a lot of things will be downloaded, Solr included. At the end you should see sheomething like this:

[INFO] Jetty 7.6.15.v20140411 Embedded started on port [8080]
[INFO] Press Ctrl-C to stop the container...

SolRDF is up and running!

Now let's add some data. Open a new shell and type the following

# curl -v http://localhost:8080/solr/store/update/bulk?commit=true \ 
  -H "Content-Type: application/n-triples" \
  --data-binary @/tmp/solrdf-download/solrdf/src/test/resources/sample-data/bsbm-generated-dataset.nt

Ok, you just added (about) 5000 triples.

SolRDF is a fully compliant SPARQL 1.1. endpoint. In order to issue a query just run a query like this:

# curl "http://127.0.0.1:8080/solr/store/sparql" \
  --data-urlencode "q=SELECT * WHERE { ?s ?p ?o } LIMIT 10" \
  -H "Accept: application/sparql-results+json"
  
Or  
  
# curl "http://127.0.0.1:8080/solr/store/sparql" \
  --data-urlencode "**q=SELECT * WHERE { ?s ?p ?o } LIMIT 10**" \
  -H "Accept: application/sparql-results+xml"