pacer-orient 2.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ lib/*.jar
2
+ pkg
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in pacer-graph.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # OrientDB Graph Database Adapter for Pacer
2
+
3
+ *Note:* The Pacer test suite does not pass with this graph adapter,
4
+ therefore this adapter is currently only experimental. Graphs with fully
5
+ passing test suites currently include TinkerGraph, Neo4j and Dex.
6
+
7
+ [Pacer](https://github.com/pangloss/pacer) is a
8
+ [JRuby](http://jruby.org) graph traversal framework built on the
9
+ [Tinkerpop](http://www.tinkerpop.com) stack.
10
+
11
+ This plugin enables full
12
+ [OrientDB](http://http://www.orientechnologies.com/) graph support in Pacer.
13
+
14
+
15
+ ## Usage
16
+
17
+ Here is how you open a OrientDB graph in Pacer.
18
+
19
+ require 'pacer'
20
+ require 'pacer-orient'
21
+
22
+ # Graph takes an OrientDB URL, e.g. disk back graph:
23
+ graph = Pacer.orient 'local:path/to/graph'
24
+
25
+ # In memory graph
26
+ graph = Pacer.orient 'memory:foo'
27
+
28
+ # Remote graph
29
+ graph = Pacer.orient 'remote:localhost/graph', 'username', 'password'
30
+
31
+ All other operations are identical across graph implementations (except
32
+ where certain features are not supported). See Pacer's documentation for
33
+ more information.
34
+
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ file 'pom.xml' => 'lib/pacer-orient/version.rb' do
5
+ pom = File.read 'pom.xml'
6
+ when_writing('Update pom.xml version number') do
7
+ open 'pom.xml', 'w' do |f|
8
+ pom.each_line do |line|
9
+ line.sub!(%r{<gem.version>.*</gem.version>}, "<gem.version>#{ Pacer::Orient::VERSION }</gem.version>")
10
+ line.sub!(%r{<blueprints.version>.*</blueprints.version>}, "<blueprints.version>#{ Pacer::Orient::BLUEPRINTS_VERSION }</blueprints.version>")
11
+ line.sub!(%r{<pipes.version>.*</pipes.version>}, "<pipes.version>#{ Pacer::Orient::PIPES_VERSION }</pipes.version>")
12
+ f << line
13
+ end
14
+ end
15
+ end
16
+ end
17
+
18
+ file Pacer::Orient::JAR_PATH => 'pom.xml' do
19
+ when_writing("Execute 'mvn package' task") do
20
+ system('mvn clean package')
21
+ end
22
+ end
23
+
24
+ task :note do
25
+ puts "NOTE: touch lib/pacer-neo4j/version.rb (or rake touch) to force everything to rebuild"
26
+ end
27
+
28
+ task :build => [:note, Pacer::Orient::JAR_PATH]
29
+ task :install => [:note, Pacer::Orient::JAR_PATH]
30
+
31
+ desc 'Touch version.rb so that the jar rebuilds'
32
+ task :touch do
33
+ system 'touch', 'lib/pacer-orient/version.rb'
34
+ end
@@ -0,0 +1,28 @@
1
+ require 'yaml'
2
+
3
+ module Pacer
4
+ class << self
5
+ # Return a graph for the given path. Will create a graph if none exists at
6
+ # that location. (The graph is only created if data is actually added to it).
7
+ def orient(url, username = nil, password = nil)
8
+ orient = com.tinkerpop.blueprints.impls.orient.OrientGraph
9
+ open = proc do
10
+ graph = Pacer.open_graphs[[url, username]]
11
+ unless graph
12
+ if username
13
+ graph = orient.new(url, username, password)
14
+ else
15
+ graph = orient.new(url)
16
+ end
17
+ Pacer.open_graphs[[url, username]] = graph
18
+ end
19
+ graph
20
+ end
21
+ shutdown = proc do |g|
22
+ g.blueprints_graph.shutdown
23
+ Pacer.open_graphs[[url, username]] = nil
24
+ end
25
+ PacerGraph.new(Pacer::YamlEncoder, open, shutdown)
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,32 @@
1
+ class RSpec::GraphRunner
2
+ module Orient
3
+ def all(usage_style = :read_write, indices = true, &block)
4
+ super
5
+ orient(usage_style, indices, &block)
6
+ end
7
+
8
+ def orient(usage_style = :read_write, indices = true, &block)
9
+ for_graph('orient', usage_style, indices, true, orient_graph, orient_graph2, orient_graph_no_indices, block)
10
+ end
11
+
12
+ protected
13
+
14
+ def orient_graph
15
+ return @orient_graph if @orient_graph
16
+ @orient_graph = Pacer.orient("memory:spec1")
17
+ end
18
+
19
+ def orient_graph2
20
+ return @orient_graph2 if @orient_graph2
21
+ @orient_graph2 = Pacer.orient("memory:spec2")
22
+ end
23
+
24
+ def orient_graph_no_indices
25
+ return @orient_graph_no_indices if @orient_graph_no_indices
26
+ @orient_graph_no_indices = Pacer.orient("memory:spec-no-idx")
27
+ @orient_graph_no_indices.drop_index :vertices
28
+ @orient_graph_no_indices.drop_index :edges
29
+ @orient_graph_no_indices
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,10 @@
1
+ module Pacer
2
+ module Orient
3
+ VERSION = "2.0.0"
4
+ JAR = "pacer-orient-#{ VERSION }-standalone.jar"
5
+ JAR_PATH = "lib/#{ JAR }"
6
+ BLUEPRINTS_VERSION = "2.1.0"
7
+ PIPES_VERSION = "2.1.0"
8
+ PACER_REQ = ">= 1.0.0"
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ require 'pacer-orient/version'
2
+
3
+ require 'pacer'
4
+ require Pacer::Orient::JAR
5
+
6
+ require 'pacer-orient/graph'
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "pacer-orient/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "pacer-orient"
7
+ s.version = Pacer::Orient::VERSION
8
+ s.platform = 'java'
9
+ s.authors = ["Paul Dlug"]
10
+ s.email = ["paul.dlug@gmail.com"]
11
+ s.homepage = "http://www.orientechnologies.com/"
12
+ s.summary = %q{OrientDB jars and related code for Pacer}
13
+ s.description = s.summary
14
+
15
+ s.add_dependency 'pacer', Pacer::Orient::PACER_REQ
16
+
17
+ s.rubyforge_project = "pacer-orient"
18
+
19
+ s.files = `git ls-files`.split("\n") + [Pacer::Orient::JAR_PATH]
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.require_paths = ["lib"]
22
+ end
@@ -0,0 +1,22 @@
1
+ <assembly>
2
+ <id>standalone</id>
3
+ <formats>
4
+ <format>jar</format>
5
+ </formats>
6
+ <includeBaseDirectory>false</includeBaseDirectory>
7
+
8
+ <fileSets>
9
+ <fileSet>
10
+ <directory>target/classes</directory>
11
+ <outputDirectory>/</outputDirectory>
12
+ </fileSet>
13
+ </fileSets>
14
+
15
+ <dependencySets>
16
+ <dependencySet>
17
+ <outputDirectory>/</outputDirectory>
18
+ <unpack>true</unpack>
19
+ <scope>runtime</scope>
20
+ </dependencySet>
21
+ </dependencySets>
22
+ </assembly>
data/pom.xml ADDED
@@ -0,0 +1,128 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+ <groupId>com.tinkerpop.pacer</groupId>
7
+ <artifactId>pacer-orient</artifactId>
8
+ <!-- NOTE: the following properties are automatically updated based on the values in lib/pacer-neo4j/version.rb -->
9
+ <properties>
10
+ <gem.version>2.0.0</gem.version>
11
+ <blueprints.version>2.1.0</blueprints.version>
12
+ <pipes.version>2.1.0</pipes.version>
13
+ </properties>
14
+ <!-- NOTE: the following properties are automatically updated based on the values in lib/pacer-neo4j/version.rb -->
15
+ <version>${gem.version}</version>
16
+ <packaging>pom</packaging>
17
+ <url>https://github.com/pangloss/pacer</url>
18
+ <name>Pacer OrientDB dependencies and related code.</name>
19
+ <description>
20
+ </description>
21
+ <inceptionYear>2011</inceptionYear>
22
+ <developers>
23
+ <developer>
24
+ <name>Paul Dlug</name>
25
+ <email>paul.dlug@gmail.com</email>
26
+ <url>http://github.com/pdlug</url>
27
+ </developer>
28
+ </developers>
29
+ <dependencies>
30
+ <!-- PROPERTY GRAPH MODEL SUPPORT -->
31
+ <dependency>
32
+ <groupId>com.tinkerpop.blueprints</groupId>
33
+ <artifactId>blueprints-core</artifactId>
34
+ <version>${blueprints.version}</version>
35
+ </dependency>
36
+ <dependency>
37
+ <groupId>com.tinkerpop.blueprints</groupId>
38
+ <artifactId>blueprints-orient-graph</artifactId>
39
+ <version>${blueprints.version}</version>
40
+ </dependency>
41
+ <!-- GRAPH TRAVERSAL SUPPORT -->
42
+ <dependency>
43
+ <groupId>com.tinkerpop</groupId>
44
+ <artifactId>pipes</artifactId>
45
+ <version>${pipes.version}</version>
46
+ </dependency>
47
+ </dependencies>
48
+
49
+ <repositories>
50
+ <repository>
51
+ <id>tinkerpop-repository</id>
52
+ <name>TinkerPop Maven2 Repository</name>
53
+ <url>http://tinkerpop.com/maven2</url>
54
+ <snapshots>
55
+ <enabled>true</enabled>
56
+ <updatePolicy>always</updatePolicy>
57
+ </snapshots>
58
+ </repository>
59
+ </repositories>
60
+
61
+ <distributionManagement>
62
+ <repository>
63
+ <id>tinkerpop-repository</id>
64
+ <name>TinkerPop Maven2 Repository</name>
65
+ <url>ftp://ftp.tinkerpop.com:21/public/maven2/</url>
66
+ </repository>
67
+ </distributionManagement>
68
+
69
+ <build>
70
+ <directory>${basedir}/target</directory>
71
+ <finalName>${project.artifactId}-${project.version}</finalName>
72
+ <resources>
73
+ <resource>
74
+ <directory>${basedir}/src/main/resources
75
+ </directory>
76
+ </resource>
77
+ </resources>
78
+ <testResources>
79
+ <testResource>
80
+ <directory>${basedir}/src/test/resources
81
+ </directory>
82
+ </testResource>
83
+ </testResources>
84
+ <plugins>
85
+ <plugin>
86
+ <artifactId>maven-compiler-plugin</artifactId>
87
+ <configuration>
88
+ <source>1.6</source>
89
+ <target>1.6</target>
90
+ </configuration>
91
+ </plugin>
92
+ <plugin>
93
+ <artifactId>maven-assembly-plugin</artifactId>
94
+ <version>2.2-beta-4</version>
95
+ <executions>
96
+ <execution>
97
+ <phase>package</phase>
98
+ <goals>
99
+ <goal>attached</goal>
100
+ </goals>
101
+ </execution>
102
+ </executions>
103
+ <configuration>
104
+ <descriptors>
105
+ <descriptor>pom/standalone.xml</descriptor>
106
+ </descriptors>
107
+ <finalName>${project.artifactId}-${project.version}</finalName>
108
+ <outputDirectory>lib</outputDirectory>
109
+ <workDirectory>target/assembly/work</workDirectory>
110
+ <tarLongFileMode>warn</tarLongFileMode>
111
+ </configuration>
112
+ </plugin>
113
+ <plugin>
114
+ <groupId>org.apache.maven.plugins</groupId>
115
+ <artifactId>maven-javadoc-plugin</artifactId>
116
+ <version>2.6.1</version>
117
+ </plugin>
118
+ </plugins>
119
+ <extensions>
120
+ <extension>
121
+ <groupId>org.apache.maven.wagon</groupId>
122
+ <artifactId>wagon-ftp</artifactId>
123
+ <version>1.0-alpha-6</version>
124
+ </extension>
125
+ </extensions>
126
+ </build>
127
+
128
+ </project>
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pacer-orient
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ prerelease:
6
+ platform: java
7
+ authors:
8
+ - Paul Dlug
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-09-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pacer
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: 1.0.0
21
+ none: false
22
+ requirement: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.0
27
+ none: false
28
+ prerelease: false
29
+ type: :runtime
30
+ description: OrientDB jars and related code for Pacer
31
+ email:
32
+ - paul.dlug@gmail.com
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - README.md
40
+ - Rakefile
41
+ - lib/pacer-orient-1.0.0-standalone.jar
42
+ - lib/pacer-orient.rb
43
+ - lib/pacer-orient/graph.rb
44
+ - lib/pacer-orient/rspec.rb
45
+ - lib/pacer-orient/version.rb
46
+ - pacer-orient.gemspec
47
+ - pom.xml
48
+ - pom/standalone.xml
49
+ - lib/pacer-orient-2.0.0-standalone.jar
50
+ homepage: http://www.orientechnologies.com/
51
+ licenses: []
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: !binary |-
61
+ MA==
62
+ none: false
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: !binary |-
68
+ MA==
69
+ none: false
70
+ requirements: []
71
+ rubyforge_project: pacer-orient
72
+ rubygems_version: 1.8.24
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: OrientDB jars and related code for Pacer
76
+ test_files: []
77
+ has_rdoc: