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 +4 -4
- data/README.md +1 -1
- data/lib/neo4apis/base.rb +9 -2
- data/neo4apis.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60ab03484b9fad4230f6bc5101b0073ab57e24b7
|
4
|
+
data.tar.gz: 58e5ca7773d65f29af7d89db1f101a780fd36913
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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,
|
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:
|
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
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.
|
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:
|
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:
|