Last active
May 24, 2016 19:38
-
-
Save lantiga/5561411 to your computer and use it in GitHub Desktop.
Working setup and sample Clojure code for Archimedes and Ogre (http://clojurewerkz.org/) on OrientDB 1.3 (http://orientdb.org/) via Blueprints (https://github.com/tinkerpop/blueprints/wiki).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject archimedes-test "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[com.orientechnologies/orient-commons "1.3.0"] | |
[com.orientechnologies/orientdb-core "1.3.0"] | |
[com.tinkerpop.blueprints/blueprints-orient-graph "2.3.0"] | |
[clojurewerkz/ogre "2.3.0.1"] | |
[clojurewerkz/archimedes "1.0.0-alpha5-SNAPSHOT"]] | |
:repositories {"sonatype" "https://oss.sonatype.org/content/groups/public/"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns archimedes-test.core | |
(:require [archimedes.core :as g] | |
[archimedes.vertex :as v] | |
[archimedes.io :as io] | |
[archimedes.edge :as e] | |
[clojure.java.io :as clj-io] | |
[ogre.core :as q]) | |
(:import (com.tinkerpop.blueprints TransactionalGraph) | |
(com.tinkerpop.blueprints TransactionalGraph$Conclusion) | |
(com.tinkerpop.blueprints.impls.orient OrientGraph))) | |
(g/set-graph! (OrientGraph. "local:orient")) | |
(g/get-graph) | |
(g/get-features) | |
(g/transact! | |
(let [v1 (v/create-with-id! nil {:name "foo"}) | |
v2 (v/create-with-id! nil {:name "bar"}) | |
v3 (v/create-with-id! nil {:name "baz"}) | |
e1 (e/connect-with-id! nil v1 :uses v2) | |
e2 (e/connect-with-id! nil v2 :uses v3)])) | |
(io/write-graph-graphml "orient.graphml") | |
(v/to-map v1) | |
(v/find-by-kv :name "foo") | |
(q/query (v/find-by-kv :name "foo") | |
q/--> | |
q/--> | |
q/into-vec!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment