swipely / pacer-titan

Pacer adapter for Titan distributed graph DB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Titan Graph Database Adapter for Pacer

Pacer is a JRuby graph traversal framework built on the Tinkerpop stack.

This is an alpha-version pacer adapter with basic support for a Titan graph in Pacer.

Installation

As always: gem 'pacer-titan'.

Backends

This gem includes Titan 0.5.4 with the Cassandra backend and ElasticSearch.

Usage

Opening a Titan graph in Pacer:

require 'pacer'
require 'pacer-titan'

g = Pacer.titan 'path/to/titan_config.properties'

The graph settings are specified in an Apache Configuration .properties file.

Titan-specific routes

You can use Titan's indexing predicates in pacer routes.

g.query{ has('text', Text::CONTAINS, 'lorem') }.out(:author)

Be sure to import com.thinkaurelius.titan.core.attribute.Text for the above example.

You can also use Titan's indexQuery() method to send queries in Lucene syntax to external indices:

g.index_query(:text, '(lorem ipsum*)', index_name: 'search').out(:author)

The index_query route can take an array of indices as the first parameter, you can also pass an options hash as the third parameter to specify the index name if it is something other than 'search' as used in most of the Titan configuration examples.

License

Based on Derrick Wiebe's pacer-dex and pacer-neo4j gems, as well as code by Steven McCraw and others on the pacer-users list. This gem is released under the liberal MIT license.

About

Pacer adapter for Titan distributed graph DB

License:Other


Languages

Language:Ruby 100.0%