-
Notifications
You must be signed in to change notification settings - Fork 4
Blazegraph Setup
You can use ldfjetty in your ruby project. To use this, add the following to your gemfile:
gem 'ldfwrapper', github: 'boston-library/ldf-wrapper', branch: "master"
Once installed, you can do the following to install and then control an instance:
rake ldfjetty:install
rake ldfjetty:start
rake ldfjetty:config
rake ldfjetty:stop
A marmotta and blazegraph instance should be available at: http://localhost:8988. For further information, see https://github.com/ActiveTriples/linked-data-fragments#blazegraph or https://github.com/boston-library/ldf-wrapper
- Get the war file (https://sourceforge.net/projects/bigdata/files/bigdata/2.1.4/):
wget https://downloads.sourceforge.net/project/bigdata/bigdata/2.1.4/blazegraph.war?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fbigdata%2Ffiles%2Fbigdata%2F2.1.4%2F&ts=1490662771&use_mirror=cytranet
-
Rename to <whatever_you_want_the_app_called>.war. I'll use an example of blazegraph.war for this.
-
Move the war file into: /var/lib/tomcat7/webapps
-
Give correct permissions to the war file
-
Restart tomcat and blazegraph should be accessible at: /blazegraph
-
Get the full vocabulary download and unzip it:
wget http://vocab.getty.edu/dataset/tgn/full.zip
unzip full.zip
-
Push the content to Blazegraph under the context of something like http://vocab.getty.edu/tgn. This command should be like:
curl -H 'Content-Type: text/turtle' --upload-file TGNOut_Full.nt -X POST "http://localhost/blazegraph/sparql?context-uri=http://vocab.getty.edu/tgn"
- Once complete, verify that it is loaded by going to Blazegraph and looking for the uri: http://vocab.getty.edu/tgn/2507399 in the Explore tab. If it shows incoming and outgoing links, it is successfully loaded.
-
Get the full vocabulary download and unzip it:
wget http://vocab.getty.edu/dataset/aat/full.zip
unzip full.zip
-
Push the content to Blazegraph under the context of something like http://vocab.getty.edu/aat. This command should be like:
curl -H 'Content-Type: text/turtle' --upload-file AATOut_Full.nt -X POST "http://localhost/blazegraph/sparql?context-uri=http://vocab.getty.edu/aat"
- Once complete, verify that it is loaded by going to Blazegraph and looking for the uri: http://vocab.getty.edu/aat/300312143 in the Explore tab. If it shows incoming and outgoing links, it is successfully loaded.
One may have loaded a vocabulary incorrectly or need to clear out a loaded vocabulary to load in a newer version. Below is a sample command for removing all of the TGN triples by using their context:
curl --get -X DELETE -H 'Accept: application/xml' 'http://localhost/blazegraph/sparql' --data-urlencode 'c=<http://vocab.getty.edu/tgn>'
- For a further example and more documentation on deletions commands, see: https://wiki.blazegraph.com/wiki/index.php/REST_API#DELETE_with_Access_Path . (There is a section after "Caution" with the following for deleting all matching a particular subject. Essentially it supports "s" for subject, "p" for predicate, "o" for object, and "c" for context as url variables). curl --get -X DELETE -H 'Accept: application/xml' 'http://localhost:8080/bigdata/sparql' --data-urlencode 's=http://www.w3.org/People/Berners-Lee/card#i'