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.
Files changed (88) hide show
  1. data/Gemfile +10 -0
  2. data/README.rdoc +64 -0
  3. data/lib/db/active_tx_log +1 -0
  4. data/lib/db/index/lucene/node/Person_exact/_0.fdt +0 -0
  5. data/lib/db/index/lucene/node/Person_exact/_0.fdx +0 -0
  6. data/lib/db/index/lucene/node/Person_exact/_0.fnm +1 -0
  7. data/lib/db/index/lucene/node/Person_exact/_0.frq +0 -0
  8. data/lib/db/index/lucene/node/Person_exact/_0.nrm +1 -0
  9. data/lib/db/index/lucene/node/Person_exact/_0.prx +0 -0
  10. data/lib/db/index/lucene/node/Person_exact/_0.tii +0 -0
  11. data/lib/db/index/lucene/node/Person_exact/_0.tis +0 -0
  12. data/lib/db/index/lucene/node/Person_exact/_1.fdt +0 -0
  13. data/lib/db/index/lucene/node/Person_exact/_1.fdx +0 -0
  14. data/lib/db/index/lucene/node/Person_exact/_1.fnm +1 -0
  15. data/lib/db/index/lucene/node/Person_exact/_1.frq +0 -0
  16. data/lib/db/index/lucene/node/Person_exact/_1.nrm +1 -0
  17. data/lib/db/index/lucene/node/Person_exact/_1.prx +0 -0
  18. data/lib/db/index/lucene/node/Person_exact/_1.tii +0 -0
  19. data/lib/db/index/lucene/node/Person_exact/_1.tis +0 -0
  20. data/lib/db/index/lucene/node/Person_exact/_2.fdt +0 -0
  21. data/lib/db/index/lucene/node/Person_exact/_2.fdx +0 -0
  22. data/lib/db/index/lucene/node/Person_exact/_2.fnm +1 -0
  23. data/lib/db/index/lucene/node/Person_exact/_2.frq +0 -0
  24. data/lib/db/index/lucene/node/Person_exact/_2.nrm +1 -0
  25. data/lib/db/index/lucene/node/Person_exact/_2.prx +0 -0
  26. data/lib/db/index/lucene/node/Person_exact/_2.tii +0 -0
  27. data/lib/db/index/lucene/node/Person_exact/_2.tis +0 -0
  28. data/lib/db/index/lucene/node/Person_exact/segments.gen +0 -0
  29. data/lib/db/index/lucene/node/Person_exact/segments_3 +0 -0
  30. data/lib/db/index/lucene-store.db +0 -0
  31. data/lib/db/index/lucene.log.active +0 -0
  32. data/lib/db/index.db +0 -0
  33. data/lib/db/messages.log +826 -0
  34. data/lib/db/neostore +0 -0
  35. data/lib/db/neostore.id +0 -0
  36. data/lib/db/neostore.nodestore.db +0 -0
  37. data/lib/db/neostore.nodestore.db.id +0 -0
  38. data/lib/db/neostore.propertystore.db +0 -0
  39. data/lib/db/neostore.propertystore.db.arrays +0 -0
  40. data/lib/db/neostore.propertystore.db.arrays.id +0 -0
  41. data/lib/db/neostore.propertystore.db.id +0 -0
  42. data/lib/db/neostore.propertystore.db.index +0 -0
  43. data/lib/db/neostore.propertystore.db.index.id +0 -0
  44. data/lib/db/neostore.propertystore.db.index.keys +0 -0
  45. data/lib/db/neostore.propertystore.db.index.keys.id +0 -0
  46. data/lib/db/neostore.propertystore.db.strings +0 -0
  47. data/lib/db/neostore.propertystore.db.strings.id +0 -0
  48. data/lib/db/neostore.relationshipstore.db +0 -0
  49. data/lib/db/neostore.relationshipstore.db.id +0 -0
  50. data/lib/db/neostore.relationshiptypestore.db +0 -0
  51. data/lib/db/neostore.relationshiptypestore.db.id +0 -0
  52. data/lib/db/neostore.relationshiptypestore.db.names +0 -0
  53. data/lib/db/neostore.relationshiptypestore.db.names.id +0 -0
  54. data/lib/db/nioneo_logical.log.active +0 -0
  55. data/lib/db/tm_tx_log.1 +0 -0
  56. data/lib/example.rb +34 -0
  57. data/lib/neo4j/identity_map.rb +109 -0
  58. data/lib/neo4j/node_mixin.rb +74 -0
  59. data/lib/neo4j/relationship_mixin.rb +62 -0
  60. data/lib/neo4j/type_converters/type_converters.rb +333 -0
  61. data/lib/neo4j-wrapper/class_methods.rb +27 -0
  62. data/lib/neo4j-wrapper/find.rb +65 -0
  63. data/lib/neo4j-wrapper/has_n/class_methods.rb +131 -0
  64. data/lib/neo4j-wrapper/has_n/decl_rel.rb +261 -0
  65. data/lib/neo4j-wrapper/has_n/instance_methods.rb +12 -0
  66. data/lib/neo4j-wrapper/has_n/nodes.rb +83 -0
  67. data/lib/neo4j-wrapper/node_mixin/class_methods.rb +53 -0
  68. data/lib/neo4j-wrapper/node_mixin/delegates.rb +140 -0
  69. data/lib/neo4j-wrapper/node_mixin/initialize.rb +43 -0
  70. data/lib/neo4j-wrapper/properties/class_methods.rb +150 -0
  71. data/lib/neo4j-wrapper/relationship_mixin/class_methods.rb +30 -0
  72. data/lib/neo4j-wrapper/relationship_mixin/delegates.rb +110 -0
  73. data/lib/neo4j-wrapper/relationship_mixin/initialize.rb +35 -0
  74. data/lib/neo4j-wrapper/rule/class_methods.rb +204 -0
  75. data/lib/neo4j-wrapper/rule/event_listener.rb +66 -0
  76. data/lib/neo4j-wrapper/rule/functions/count.rb +45 -0
  77. data/lib/neo4j-wrapper/rule/functions/function.rb +76 -0
  78. data/lib/neo4j-wrapper/rule/functions/sum.rb +31 -0
  79. data/lib/neo4j-wrapper/rule/instance_methods.rb +16 -0
  80. data/lib/neo4j-wrapper/rule/neo4j_core_ext/traverser.rb +29 -0
  81. data/lib/neo4j-wrapper/rule/rule.rb +134 -0
  82. data/lib/neo4j-wrapper/rule/rule_node.rb +205 -0
  83. data/lib/neo4j-wrapper/version.rb +5 -0
  84. data/lib/neo4j-wrapper/wrapper.rb +38 -0
  85. data/lib/neo4j-wrapper.rb +35 -0
  86. data/lib/test.rb +61 -0
  87. data/neo4j-wrapper.gemspec +31 -0
  88. metadata +162 -0
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source :gemcutter
2
+
3
+ gemspec
4
+
5
+ group 'test' do
6
+ gem "rake", ">= 0.8.7"
7
+ gem "rspec", "~> 2.8"
8
+ gem "its" # its(:with, :arguments) { should be_possible }
9
+ end
10
+
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
@@ -0,0 +1 @@
1
+ ����_id_ageQ
@@ -0,0 +1 @@
1
+ NRM�|
@@ -0,0 +1 @@
1
+ ����_id_ageQ
@@ -0,0 +1 @@
1
+ NRM�|
@@ -0,0 +1 @@
1
+ ����_id_ageQ
@@ -0,0 +1 @@
1
+ NRM�|
Binary file
Binary file
data/lib/db/index.db ADDED
Binary file