What is --with-indices in AllegroGraph

362 views Asked by At

I am trying to load data into Allegro Graph server and one of the parameters is --with-indices. Can anybody explain what is it about?

I have read the entire Allegro Graph documentation and it mentions that indices can be spogi, sopgi, etc, but it does not mention as to what they are about.

Please explain precisely. (I am not asking for full-forms of spogi, sopgi, etc. What I want is their exact meaning.)

1

There are 1 answers

0
jjon On BEST ANSWER

Your triple store contains triples spo (subject, predicate, object). A query against a graph so stored may have to traverse a lot of the graph to find nodes that match your query. AllegroGraph can store indices that make that traversal faster: finding all predicates that match first, for example, and the subject and object nodes that are attached, it can use an index that finds the predicates first pso. If your triples have named graphs you can add g and, all your triples have ids i. So AG can use an index psogi. (From the docs: AllegroGraph Triple Indices)

An AG triple store is created with a default set of indices. Generating specialized indices is resource intensive, but if you know what kinds of queries you're going to be getting, you may find it worthwhile to specify the appropriate indices to optimize response times.

If you're loading from the command line:

The following example loads a single file into AllegroGraph.

./agload --with-indices "ospgi,posgi,spogi" The triple store will generate three triple indices: ospgi, posgi and spogi.

(from the docs for agload)

if you're using the REST interface, you can create your repositories with specified indices:

PUT /repositories/[name]

with the parameter index:

index Can be specified any number of times. Should hold index IDs, and is used to configure the set of indices created for the store.

(from the docs for put repo)

Or you can load your triples and then do:

PUT /repositories/[name]/indices/[type] Ensures that the index indicated by type is present in this store. Takes effect at commit time (which is, of course, immediately when using a shared back-end or an auto-commit session).

(from the docs for put index)