neo4apis 0.8.2 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a58b0dee0b3876ab01c593b6f6de56269f62e05
4
- data.tar.gz: 4f64e5c69ff76aa6cbeb425f51b01cba05087b76
3
+ metadata.gz: 60ab03484b9fad4230f6bc5101b0073ab57e24b7
4
+ data.tar.gz: 58e5ca7773d65f29af7d89db1f101a780fd36913
5
5
  SHA512:
6
- metadata.gz: 7924adbf6a17df994464d53c414346c9462f63ce4a30f4293a59173401572de73d2caf226d283534630af0d5ba39b606aaa7d77fef96586fff7e08e680aa2413
7
- data.tar.gz: 38bf1b6b7fa6b324df7373b7dea5b53428f72a6a26f349b7df54a48cbf6a3dbb6e4cf24f5be74ffe526bf174c3357d3c965bf2289cb01cbcf50e13b9a64e2784
6
+ metadata.gz: 0133f2410bc9c91dc47d3597a0d69fcb3167db2683b16f54aabbbb84014823ac342d7114240001d1be7d7a6d471ef5302921dbf17b2d4681dfeebf7fac4b20ac
7
+ data.tar.gz: 377f05bb158c208a8a43bf5884861139b705351adb8cc0a316afca6366019c382d88a318f168f351ab6f56974189649251db333f542c26a900639152ba4244c9
data/README.md CHANGED
@@ -17,7 +17,7 @@ In the below example we assume that a variable `awesome_client` is passed in whi
17
17
  module Neo4Apis
18
18
  class AwesomeSite < Base
19
19
  # Adds a prefix to labels so that they become AwesomeSiteUser and AwesomeSiteWidget (optional)
20
- prefix :AwesomeSite
20
+ common_label :AwesomeSite
21
21
 
22
22
  # Number of queries which are built up until batch request to DB is made (optional, default = 500)
23
23
  batch_size 2000
data/lib/neo4apis/base.rb CHANGED
@@ -120,15 +120,22 @@ module Neo4Apis
120
120
  def create_node_query(node_proxy)
121
121
  return if node_proxy.props.empty?
122
122
 
123
+ props = node_proxy.props
124
+ extra_labels = props.delete(:_extra_labels)
125
+
123
126
  cypher = <<-QUERY
124
127
  MERGE (node:`#{node_proxy.label}` {#{node_proxy.uuid_field}: {uuid_value}})
125
- SET #{set_attributes(:node, node_proxy.props.keys)}
128
+ SET #{set_attributes(:node, props.keys)}
126
129
  QUERY
127
130
 
128
131
  cypher << " SET node:`#{self.class.common_label}`" if self.class.common_label
129
132
 
133
+ (extra_labels || []).each do |label|
134
+ cypher << " SET node:`#{label}`"
135
+ end
136
+
130
137
  OpenStruct.new({to_cypher: cypher,
131
- merge_params: {uuid_value: node_proxy.uuid_value, props: node_proxy.props}})
138
+ merge_params: {uuid_value: node_proxy.uuid_value, props: props}})
132
139
  end
133
140
 
134
141
  def create_relationship_query(type, source, target, props)
data/neo4apis.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.unshift lib unless $:.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "neo4apis"
6
- s.version = '0.8.2'
6
+ s.version = '0.9.0'
7
7
  s.required_ruby_version = ">= 1.9.1"
8
8
 
9
9
  s.authors = "Brian Underwood"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4apis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-28 00:00:00.000000000 Z
11
+ date: 2016-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -102,8 +102,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.4.5
105
+ rubygems_version: 2.4.5.1
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: An API to import web API data to neo4j
109
109
  test_files: []
110
+ has_rdoc: