sul-dlss/sparqlight

Name: sparqlight

Owner: Stanford University Digital Library

Description: A blacklight application using SPARQL to replace Solr

Created: 2015-11-19 19:42:01.0

Updated: 2018-03-22 13:57:26.0

Pushed: 2017-04-26 23:42:49.0

Homepage:

Size: 5725

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

README

General Approach
Setup

On a Mac, install Homebrew.

Using Homebrew, install MongoDB:

Follow steps to have MongoDB start on login and run lanuchctl to start immediately (details may vary):

Subsequently, perform rails initialization:

Tests can be run using:

S_ENV=test bundle exec rake db:test:prepare
S_ENV=test bundle exec rake db:seed
S_ENV=test bundle exec rake

Service can be run locally using bundle exec rails server

Running on Blazegraph
Installing Blazegraph for macOS

Follow steps to have MongoDB start on login and run lanuchctl to start immediately (details may vary):

sudo cp -fv /usr/local/opt/blazegraph/*.plist /Library/LaunchDaemons
sudo chown root /Library/LaunchDaemons/homebrew.mxcl.blazegraph.plist

Then to load blazegraph now:

sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.blazegraph.plist

Or, if you don't want/need launchctl, you can just run:

blazegraph start
Installing Blazegraph for Debian/Ubuntu

Blazegraph installation instructions are at

MongoDB installation instructions are at

Configuring Blazegraph
Production

Once the data is loaded into blazegraph, return to the sparqlite console to perform rails initialization:

le install
S_ENV=production bundle exec rake db:migrate
S_ENV=production bundle exec rake db:seed # this is done manually above
S_ENV=production bundle exec rake secrets
d that value to `config/secrets.yml`

Run the server in production mode pointing to this BlazeGraph SPARQL endpoint:

rt SPARQL_URL=http://localhost:9999/blazegraph/namespace/sparqlite/sparql
S_ENV=production bundle exec rails server
Development (demonstrations)
rt SPARQL_URL=http://localhost:9999/blazegraph/namespace/sparqlite-development/sparql
ILS_ENV=development is the default
le exec rails s
Tests
rt SPARQL_URL=http://localhost:9999/blazegraph/namespace/sparqlite-test/sparql
S_ENV=test bundle exec rake db:test:prepare
S_ENV=test bundle exec rake db:seed # may not work as expected, but manual loading is done as above
S_ENV=test bundle exec rake

 view the test data in the application:
S_ENV=development bundle exec rails s

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.