neo4j-wrapper 0.0.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +10 -0
- data/README.rdoc +64 -0
- data/lib/db/active_tx_log +1 -0
- data/lib/db/index/lucene/node/Person_exact/_0.fdt +0 -0
- data/lib/db/index/lucene/node/Person_exact/_0.fdx +0 -0
- data/lib/db/index/lucene/node/Person_exact/_0.fnm +1 -0
- data/lib/db/index/lucene/node/Person_exact/_0.frq +0 -0
- data/lib/db/index/lucene/node/Person_exact/_0.nrm +1 -0
- data/lib/db/index/lucene/node/Person_exact/_0.prx +0 -0
- data/lib/db/index/lucene/node/Person_exact/_0.tii +0 -0
- data/lib/db/index/lucene/node/Person_exact/_0.tis +0 -0
- data/lib/db/index/lucene/node/Person_exact/_1.fdt +0 -0
- data/lib/db/index/lucene/node/Person_exact/_1.fdx +0 -0
- data/lib/db/index/lucene/node/Person_exact/_1.fnm +1 -0
- data/lib/db/index/lucene/node/Person_exact/_1.frq +0 -0
- data/lib/db/index/lucene/node/Person_exact/_1.nrm +1 -0
- data/lib/db/index/lucene/node/Person_exact/_1.prx +0 -0
- data/lib/db/index/lucene/node/Person_exact/_1.tii +0 -0
- data/lib/db/index/lucene/node/Person_exact/_1.tis +0 -0
- data/lib/db/index/lucene/node/Person_exact/_2.fdt +0 -0
- data/lib/db/index/lucene/node/Person_exact/_2.fdx +0 -0
- data/lib/db/index/lucene/node/Person_exact/_2.fnm +1 -0
- data/lib/db/index/lucene/node/Person_exact/_2.frq +0 -0
- data/lib/db/index/lucene/node/Person_exact/_2.nrm +1 -0
- data/lib/db/index/lucene/node/Person_exact/_2.prx +0 -0
- data/lib/db/index/lucene/node/Person_exact/_2.tii +0 -0
- data/lib/db/index/lucene/node/Person_exact/_2.tis +0 -0
- data/lib/db/index/lucene/node/Person_exact/segments.gen +0 -0
- data/lib/db/index/lucene/node/Person_exact/segments_3 +0 -0
- data/lib/db/index/lucene-store.db +0 -0
- data/lib/db/index/lucene.log.active +0 -0
- data/lib/db/index.db +0 -0
- data/lib/db/messages.log +826 -0
- data/lib/db/neostore +0 -0
- data/lib/db/neostore.id +0 -0
- data/lib/db/neostore.nodestore.db +0 -0
- data/lib/db/neostore.nodestore.db.id +0 -0
- data/lib/db/neostore.propertystore.db +0 -0
- data/lib/db/neostore.propertystore.db.arrays +0 -0
- data/lib/db/neostore.propertystore.db.arrays.id +0 -0
- data/lib/db/neostore.propertystore.db.id +0 -0
- data/lib/db/neostore.propertystore.db.index +0 -0
- data/lib/db/neostore.propertystore.db.index.id +0 -0
- data/lib/db/neostore.propertystore.db.index.keys +0 -0
- data/lib/db/neostore.propertystore.db.index.keys.id +0 -0
- data/lib/db/neostore.propertystore.db.strings +0 -0
- data/lib/db/neostore.propertystore.db.strings.id +0 -0
- data/lib/db/neostore.relationshipstore.db +0 -0
- data/lib/db/neostore.relationshipstore.db.id +0 -0
- data/lib/db/neostore.relationshiptypestore.db +0 -0
- data/lib/db/neostore.relationshiptypestore.db.id +0 -0
- data/lib/db/neostore.relationshiptypestore.db.names +0 -0
- data/lib/db/neostore.relationshiptypestore.db.names.id +0 -0
- data/lib/db/nioneo_logical.log.active +0 -0
- data/lib/db/tm_tx_log.1 +0 -0
- data/lib/example.rb +34 -0
- data/lib/neo4j/identity_map.rb +109 -0
- data/lib/neo4j/node_mixin.rb +74 -0
- data/lib/neo4j/relationship_mixin.rb +62 -0
- data/lib/neo4j/type_converters/type_converters.rb +333 -0
- data/lib/neo4j-wrapper/class_methods.rb +27 -0
- data/lib/neo4j-wrapper/find.rb +65 -0
- data/lib/neo4j-wrapper/has_n/class_methods.rb +131 -0
- data/lib/neo4j-wrapper/has_n/decl_rel.rb +261 -0
- data/lib/neo4j-wrapper/has_n/instance_methods.rb +12 -0
- data/lib/neo4j-wrapper/has_n/nodes.rb +83 -0
- data/lib/neo4j-wrapper/node_mixin/class_methods.rb +53 -0
- data/lib/neo4j-wrapper/node_mixin/delegates.rb +140 -0
- data/lib/neo4j-wrapper/node_mixin/initialize.rb +43 -0
- data/lib/neo4j-wrapper/properties/class_methods.rb +150 -0
- data/lib/neo4j-wrapper/relationship_mixin/class_methods.rb +30 -0
- data/lib/neo4j-wrapper/relationship_mixin/delegates.rb +110 -0
- data/lib/neo4j-wrapper/relationship_mixin/initialize.rb +35 -0
- data/lib/neo4j-wrapper/rule/class_methods.rb +204 -0
- data/lib/neo4j-wrapper/rule/event_listener.rb +66 -0
- data/lib/neo4j-wrapper/rule/functions/count.rb +45 -0
- data/lib/neo4j-wrapper/rule/functions/function.rb +76 -0
- data/lib/neo4j-wrapper/rule/functions/sum.rb +31 -0
- data/lib/neo4j-wrapper/rule/instance_methods.rb +16 -0
- data/lib/neo4j-wrapper/rule/neo4j_core_ext/traverser.rb +29 -0
- data/lib/neo4j-wrapper/rule/rule.rb +134 -0
- data/lib/neo4j-wrapper/rule/rule_node.rb +205 -0
- data/lib/neo4j-wrapper/version.rb +5 -0
- data/lib/neo4j-wrapper/wrapper.rb +38 -0
- data/lib/neo4j-wrapper.rb +35 -0
- data/lib/test.rb +61 -0
- data/neo4j-wrapper.gemspec +31 -0
- metadata +162 -0
data/Gemfile
ADDED
data/README.rdoc
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
== Neo4j-wrapper {<img src="https://secure.travis-ci.org/andreasronge/neo4j-wrapper.png" />}[http://travis-ci.org/andreasronge/neo4j-wrapper]
|
|
2
|
+
|
|
3
|
+
This contains the Ruby wrapper of the Neo4j::Node and Neo4j::Relationship java object defined in the neo4j-core gem.
|
|
4
|
+
The neo4j.rb gem will be split up into several gems, neo4j-core, neo4j-wrapper and neo4j-rails (?)
|
|
5
|
+
This gem will be included by neo4j 2.0.0 gem.
|
|
6
|
+
|
|
7
|
+
== Docs
|
|
8
|
+
|
|
9
|
+
* {YARD}[http://rdoc.info/github/andreasronge/neo4j-wrapper/file/README.rdoc]
|
|
10
|
+
|
|
11
|
+
== The public API
|
|
12
|
+
|
|
13
|
+
{Neo4j::NodeMixin} The Java Neo4j Node
|
|
14
|
+
|
|
15
|
+
{Neo4j::RelationshipMixin} The Java Relationship
|
|
16
|
+
|
|
17
|
+
{Neo4j::IdentityMap} The Identity Map
|
|
18
|
+
|
|
19
|
+
== Example
|
|
20
|
+
|
|
21
|
+
class Company
|
|
22
|
+
include Neo4j::NodeMixin
|
|
23
|
+
has_n(:employees)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class Person
|
|
27
|
+
include Neo4j::NodeMixin
|
|
28
|
+
property :name
|
|
29
|
+
property :age, :size, :type => Fixnum, :index => :exact
|
|
30
|
+
property :description, :index => :fulltext
|
|
31
|
+
|
|
32
|
+
has_one(:best_friend)
|
|
33
|
+
has_n(:employed_by).from(:employees)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
Neo4j::Transaction.run do
|
|
37
|
+
Person.new(:name => 'jimmy', :age => 35)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
person = Person.find(:age => (10..42)).first
|
|
41
|
+
|
|
42
|
+
Neo4j::Transaction.run do
|
|
43
|
+
person.best_friend = Person.new
|
|
44
|
+
person.employed_by << Company.new(:name => "Foo ab")
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# find by navigate incoming relationship
|
|
48
|
+
company = person.employed_by.find { |p| p[:name] == 'Foo ab' }
|
|
49
|
+
puts "Person #{person.name} employed by #{company[:name]}"
|
|
50
|
+
# navigate the outgoing relationship:
|
|
51
|
+
company.employees.each {|x| puts x.name}
|
|
52
|
+
|
|
53
|
+
== Changes
|
|
54
|
+
|
|
55
|
+
Changes from the neo4j.rb
|
|
56
|
+
* Use of YARD instead of RDoc
|
|
57
|
+
* Some tidy up of the API and code
|
|
58
|
+
* Change of Ruby module structure.
|
|
59
|
+
* More RSpecs and more use of mocking combined with real testing of the Java layer
|
|
60
|
+
* Make sure that we retrieve relationships and nodes lazy if possible.
|
|
61
|
+
|
|
62
|
+
This gem contains two modules: Neo4j and Neo4j::Wrapper
|
|
63
|
+
The Neo4j module is public and the Neo4j::Wrapper(::*) are private modules.
|
|
64
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tm_tx_log.1
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
����_id_ageQ
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NRM�|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
����_id_ageQ
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NRM�|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
����_id_ageQ
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NRM�|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/db/index.db
ADDED
|
Binary file
|