• Stars
    star
    126
  • Rank 284,490 (Top 6 %)
  • Language
    Clojure
  • Created over 11 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Clojure library for querying Apache TinkerPop graphs

Ogre

Ogre is a Clojure Gremlin Language Variant of the Gremlin graph traversal language from Apache Tinkerpop. Like Gremlin, it can be used to query any graphs that are TinkerPop-enabled.

Project Goals

  • Provide an API that enhances the expressivity of Gremlin when working in Clojure.
  • Expose the features of TinkerPop as it makes sense in Clojure.
  • Don't introduce any significant amount of performance overhead.

Community

Questions related to Ogre can be asked on the clojure-titanium mailing list.

To subscribe for announcements of releases, important changes and so on, please follow @ClojureWerkz on Twitter.

Project Maturity

Despite being first released in 2014, Orge is a relatively young project that regained active development in 2016. Most of Ogre's features are driven by changes to Apache TinkerPop (specifically the Traversal API) which has largely stabilized itself in over the course of the 3.2.x line of code. As a result, Ogre tends to be fairly stable with its implementation of that API. Ogre also implements the TinkerPop Process Test Suite, which helps validate that Ogre is compliant with Gremlin.

Ogre currently targets TinkerPop 3.4.x.

Artifacts

Orge artifacts are released to Clojars. Maven users should add the following repository definition to your pom.xml:

<repository>
  <id>clojars.org</id>
  <url>http://clojars.org/repo</url>
</repository>

The Most Recent Release

With Leiningen:

[clojurewerkz/ogre "3.4.11.0"]

With Maven:

<dependency>
  <groupId>clojurewerkz</groupId>
  <artifactId>ogre</artifactId>
  <version>3.4.11.0</version>
</dependency>

Documentation & Examples

You'll need to choose a TinkerPop-enabled graph database and add that to your project's dependencies. Here we use the in-memory graph database implementation provided by org.apache.tinkerpop/tinkergraph-gremlin, e.g.:

With Leiningen:

[org.apache.tinkerpop/tinkergraph-gremlin "3.4.11"]

With Maven:

<dependency>
  <groupId>org.apache.tinkerpop</groupId>
  <artifactId>tinkergraph-gremlin</artifactId>
  <version>3.4.11</version>
</dependency>

REPL examples:

user=> (load "clojurewerkz/ogre/core")
nil
user=> (in-ns 'clojurewerkz.ogre.core)
#object[clojure.lang.Namespace 0x2bcfe59c "clojurewerkz.ogre.core"]
clojurewerkz.ogre.core=> (def graph (open-graph {(Graph/GRAPH) (.getName org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph)}))
#'clojurewerkz.ogre.core/graph
clojurewerkz.ogre.core=> (def g (traversal graph))
#'clojurewerkz.ogre.core/g
clojurewerkz.ogre.core=> (org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory/generateModern graph)
nil
clojurewerkz.ogre.core=> (traverse g V (match
                    #_=>   (__ (as :a) (out :created) (as :b))
                    #_=>   (__ (as :b) (has :name "lop"))
                    #_=>   (__ (as :b) (in :created) (as :c))
                    #_=>   (__ (as :c) (has :age 29)))
                    #_=>   (select :a :c) (by :name)
                    #_=>   (into-seq!))
({"a" "marko", "c" "marko"} {"a" "josh", "c" "marko"} {"a" "peter", "c" "marko"})

As an alternative to embedded graph databases like TinkerGraph, you might also choose to utilize a remote graph (e.g. one hosted in Gremlin Server or a Remote Gremlin Provider). In such case, you would first need org.apache.tinkerpop/gremlin-driver to connect to the remote graph:

With Leiningen:

[org.apache.tinkerpop/gremlin-driver "3.4.11"]

With Maven:

<dependency>
  <groupId>org.apache.tinkerpop</groupId>
  <artifactId>gremlin-driver</artifactId>
  <version>3.4.11</version>
</dependency>

From the driver, you create a DriverRemoteConnection and pass that to the traversal function (rather than the Graph instance as demonstrated in the last example):

clojurewerkz.ogre.core=> (def conn (org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection/using "localhost" 8182 "g"))
#'clojurewerkz.ogre.core/conn
clojurewerkz.ogre.core=> (def g (traversal conn))
#'clojurewerkz.ogre.core/g
clojurewerkz.ogre.core=> (traverse g V (has :name "josh") (values :age) (into-seq!))
(32)

In short, to connect to a remote graph simply use Java interop to construct a DriverRemoteConnection instance in the ways specified by the TinkerPop Reference Documentation and then give that object to the traversal function to create g.

Ogre has more complete documentation here.

Supported Clojure Versions

Orge requires Clojure 1.8+. The most recent stable release is always recommended.

Continuous Integration

Build Status

Development

Orge uses Leiningen 2. Once installed and run tests using:

lein test

License

Copyright (C) 2014-2017 Zack Maril, and the ClojureWerkz team. Copyright (C) 2017-2021 Stephen Mallette, Zack Maril, and the ClojureWerkz team.

Licensed under the Eclipse Public License (the same as Clojure).

Acknowledgements

Joe Lee illustrated the "Gremlin Ogre" image based on the original Clojurewerkz Ogre logo and Apache TinkerPop's Gremlin character developed Ketrina Yim.

More Repositories

1

elastisch

A minimalistic Clojure client for ElasticSearch, supports both HTTP and native transports
Clojure
386
star
2

meltdown

Clojure interface to Reactor, an event-driven programming and stream processing toolkit for the JVM
Clojure
208
star
3

buffy

Buffy The ByteBuffer Slayer, Clojure library for working with binary data.
Clojure
194
star
4

money

A Clojure library that deals with monetary values and currencies. Built on top of Joda Money.
Clojure
151
star
5

eep

Embedded Event Processing in Clojure
Clojure
140
star
6

cassaforte

Modern, high-level Clojure driver (client) for Cassandra build around CQL 3
Clojure
123
star
7

balagan

Clojure data structure manipulation and querying library
Clojure
119
star
8

titanium

Clojure graph library built on top of Titan
Clojure
106
star
9

mailer

An ActionMailer-inspired mailer library. Combines Postal, Clostache, some conventions and support for multiple delivery modes
Clojure
105
star
10

route-one

Tiny Clojure library that generates HTTP resource routes (as in Ruby on Rails, Jersey, Django, Sinatra, Flask and similar)
Clojure
94
star
11

scrypt

A Clojure library for the scrypt key derivation function. Use it to encrypt passwords and other sensitive data.
Clojure
85
star
12

envision

Clojure Data Visualisation library, based on Statistiker and D3
Clojure
78
star
13

machine_head

Clojure MQTT client
Clojure
71
star
14

spyglass

A Clojure Memcached client (also: Couchbase, Kestrel). Built on top of SpyMemcached, supports ASCII and binary protocols, strives to be 100% feature complete.
Clojure
67
star
15

statistiker

Minimalistic statistics library for Clojure
Clojure
63
star
16

gizmo

Gizmo is an effortless way to create web applications in Clojure
Clojure
41
star
17

elephant

Modern Clojure client for the Stripe API
Clojure
38
star
18

archimedes

Clojure library for Blueprints (part of the Tinkerpop graph stack).
Clojure
38
star
19

docslate

Base repository for the ClojureWerkz project documentation guides
CSS
35
star
20

serialism

A tiny Clojure library that serializes and deserializes values into popular formats based on provided content type
Clojure
31
star
21

persephone

Clojure DSL that generates [Neo4J] Cypher queries
Clojure
15
star
22

monger.docs

Documentation site for Monger
JavaScript
14
star
23

romulan

LMAX Disruptor in Clojure embrace
Clojure
14
star
24

support

A support library ClojureWerkz projects (Langohr, Monger, Neocons, Elastisch, Quartzite, Welle, and others) can rely on
Clojure
14
star
25

streampunk

Clojure library for stream summarization, cardinality estimation, all that jazz
Clojure
11
star
26

ssese

Clojure Server-Sent Events (SSE) client built with Netty 5.
Clojure
9
star
27

elastisch.docs

Documentation site for Elastisch
HTML
8
star
28

triennium

Small efficient MQTT topic routing library
Clojure
6
star
29

lein-template

A Leiningen 2.0 project template for all new ClojureWerkz libraries
Clojure
6
star
30

legacy-blog

blog.clojurewerkz.org
JavaScript
5
star
31

vat

Minimalistic client for vatapi.com
Clojure
5
star
32

quartzite.docs

Documentation site for Quartzite, a powerful Clojure scheduling library built on top of Quartz
CSS
5
star
33

neocons.docs

Documentation guides for Neocons
HTML
4
star
34

langohr.examples

Code examples used in Langohr documentation guides
Clojure
4
star
35

titanium.docs

Documentation site for Titanium, see http://titanium.clojurewerkz.org
CSS
4
star
36

machine_head.examples

Code examples for Machine Head, a Clojure MQTT client
Clojure
3
star
37

validateur.docs

Documentation site for Validateur
Sass
2
star
38

welle.docs

Documentation site for Welle, an expressive Clojure client for Riak
CSS
2
star
39

clojurewerkz.org

clojurewerkz.org website
HTML
2
star
40

gizmo.docs

Docs for Gizmo, Clojurewerkz web library
Ruby
1
star
41

spyglass.docs

Spyglass documentation site
Sass
1
star
42

ogre.docs

Documentation site for Ogre, see http://ogre.clojurewerkz.org
CSS
1
star
43

archimedes.docs

Documentation site for Archimedes
CSS
1
star
44

mold

Clojure client for CloudFoundry (primarily UAA and Cloud Controller)
Clojure
1
star
45

elastisch.shield

Elastic Shield support for Elastisch
Clojure
1
star
46

machine_head.docs

Machine Head documentation site
HTML
1
star