Skip to content
Joshua Shinavier edited this page Aug 8, 2020 · 5 revisions

This page will show you how to connect a Jig client to a session on an AllegroGraph server and begin issuing queries over a repository. Note that all of the below refers to the Java implementation of Jig (i.e. jig-*.jar and jig.sh), as opposed to the pure JavaScript implementation.

Build Jig

As a very first step, you will need to check out the Jig code base using Git and build the project using Maven:

git clone git@github.com:joshsh/jig.git
cd jig
mvn install

This will produce the file target/jig-[version].jar; you can now launch Jig using jig.sh (see below).

Start an AllegroGraph session

Jig is a client-server application in which the client REPL communicates with a JavaScript environment which is contained in an AllegroGraph server. In order to set up the environment, you must first create a session on the server. You can do this in AGWebView by visiting the page for the repository you want to query with Jig, then clicking "Start a session". Note that in order to create sessions, you need a SessionPorts entry in agraph.cfg (see Server Installation).

Once you have started a session, you will be taken to a page with a URL like the following:

http://example.org/catalogs/mycat/repositories/myrepo/session/9091/sessions/23593b0f-eab5-3b04-4d64-003048fde8f8

This will be used as the endpoint and session identifier. Copy it for pasting into Jig's config file.

Add credentials and the session ID to a config file

To allow Jig to connect to your newly-created session, you need the endpoint and session ID as well as well as the name and password of a user with access to the repository. Add these three items to a properties file like the following:

com.franz.jig.username = myuser
com.franz.jig.password = mypass
com.franz.jig.session = http://example.org/catalogs/mycat/repositories/myrepo/session/9091/sessions/23593b0f-eab5-3b04-4d64-003048fde8f8

Pass the config file to Jig

Assuming that you have named the above configuration file jig.props, start Jig with:

./jig.sh jig.props

You should now see the Jig REPL prompt, where you can begin typing in queries:

jig)  

Test your connection

You can verify that you are connected to the intended repository by counting triples:

store.size

or quering for a few triples:

g.triples.limit(10)

Happy Jigging.

Clone this wiki locally