solis 0.68.0 → 0.69.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/solis/graph.rb +10 -19
- data/lib/solis/version.rb +1 -1
- data/solis.gemspec +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb7b4c2f87c4dfaa321b9e986296cbcef41849230a8c29efcd3385e6168e7034
|
4
|
+
data.tar.gz: 9992f2c9eef0d56c9ec0fc53fa68b45a8b5efb8e9065ddd637427c9f7a3b2087
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0284ecdce9377633bddef224daf54c25862a65e3eef78995db67b61380cae989958c088aba229c3ee100106008c948031679d61b845f4a8dbfacc5d540e0ebfb'
|
7
|
+
data.tar.gz: d6cbf0d9e0bcf54c7e5a129eb56575bea5af2391ab9f64afdd268c420e747c3c2f5577b5ce84d05ca8f8de6acf094287d3732e31fb5e8ceb2bddd89fc408eb29
|
data/lib/solis/graph.rb
CHANGED
@@ -275,16 +275,13 @@ module Solis
|
|
275
275
|
remote_resources = resource.instance_variable_get("@#{key}")
|
276
276
|
if remote_resources
|
277
277
|
remote_resources = [remote_resources] unless remote_resources.is_a?(Array)
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
"#{resource.class.graph_name.gsub(/\/$/,'')}/#{belongs_to_resource_name.tableize}/#{resource_id}"
|
278
|
+
resource_ids = remote_resources.map do |remote_resource|
|
279
|
+
remote_resource.id =~ /^http/ ? remote_resource.id.split('/').last : remote_resource.id
|
282
280
|
end
|
283
281
|
|
284
282
|
end
|
285
283
|
|
286
|
-
|
287
|
-
remote_resources.join(',') if remote_resources #belongs_to
|
284
|
+
"#{resource.class.graph_name.gsub(/\/$/,'')}/#{belongs_to_resource_name.tableize}?filter[id]=#{resource_ids.join(',')}" unless remote_resources.nil? || resource_ids.empty?
|
288
285
|
end
|
289
286
|
end
|
290
287
|
else
|
@@ -296,18 +293,15 @@ module Solis
|
|
296
293
|
|
297
294
|
belongs_to_resource.belongs_to(resource.model.name.tableize.singularize, foreign_key: :id, primary_key: :id, resource: graph.shape_as_resource(resource.model.name)) do
|
298
295
|
link do |resource|
|
296
|
+
ids=[]
|
299
297
|
remote_resources = resource.instance_variable_get("@#{shape_name.tableize.singularize}")
|
300
298
|
if remote_resources
|
301
299
|
remote_resources = [remote_resources] unless remote_resources.is_a?(Array)
|
302
|
-
|
303
|
-
|
304
|
-
#"/#{key.tableize}/#{resource_id}"
|
305
|
-
"#{resource.class.graph_name.gsub(/\/$/,'')}/#{belongs_to_resource.name.tableize}/#{resource_id}"
|
300
|
+
resource_ids = remote_resources.map do |remote_resource|
|
301
|
+
remote_resource.id =~ /^http/ ? remote_resource.id.split('/').last : remote_resource.id
|
306
302
|
end
|
307
|
-
|
308
|
-
# return remote_resources.length == 1 ? remote_resources.first : remote_resources
|
309
303
|
end
|
310
|
-
|
304
|
+
"#{resource.class.graph_name.gsub(/\/$/,'')}/#{belongs_to_resource.name.tableize}?filter[id]=#{resource_ids.join(',')}" unless remote_resources.nil? || resource_ids.empty?
|
311
305
|
end
|
312
306
|
end
|
313
307
|
#
|
@@ -315,15 +309,12 @@ module Solis
|
|
315
309
|
remote_resources = resource.instance_variable_get("@#{key}")
|
316
310
|
if remote_resources
|
317
311
|
remote_resources = [remote_resources] unless remote_resources.is_a?(Array)
|
318
|
-
|
319
|
-
|
320
|
-
#"/#{key.tableize}/#{resource_id}"
|
321
|
-
"#{resource.class.graph_name.gsub(/\/$/,'')}/#{remote_resource.name.tableize}/#{resource_id}"
|
312
|
+
resource_ids = remote_resources.map do |remote_resource|
|
313
|
+
remote_resource.id =~ /^http/ ? remote_resource.id.split('/').last : remote_resource.id
|
322
314
|
end
|
323
315
|
|
324
|
-
#return remote_resources.length == 1 ? remote_resources.first : remote_resources
|
325
316
|
end
|
326
|
-
remote_resources.join(',')
|
317
|
+
"#{resource.class.graph_name.gsub(/\/$/,'')}/#{remote_resources.first.name.tableize}?filter[id]=#{resource_ids.join(',')}" unless remote_resources.nil? || resource_ids.empty?
|
327
318
|
end
|
328
319
|
end
|
329
320
|
end
|
data/lib/solis/version.rb
CHANGED
data/solis.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.email = ['mehmet@celik.be']
|
8
8
|
|
9
9
|
spec.summary = 'Turn any SHACL file into an API, ORM, documentation, ...'
|
10
|
-
spec.description = 'The SUN in latin or is it SILOS spelled backwards.
|
10
|
+
spec.description = 'The SUN in latin or is it SILOS spelled backwards. Turn any SHACL file or Google sheet into an API, ORM, documentation on top of a data store'
|
11
11
|
spec.homepage = 'https://github.com/mehmetc/solis'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.69.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mehmet Celik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -220,9 +220,8 @@ dependencies:
|
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: 5.15.0
|
223
|
-
description: The SUN in latin or is it SILOS spelled backwards.
|
224
|
-
|
225
|
-
store)
|
223
|
+
description: The SUN in latin or is it SILOS spelled backwards. Turn any SHACL file
|
224
|
+
or Google sheet into an API, ORM, documentation on top of a data store
|
226
225
|
email:
|
227
226
|
- mehmet@celik.be
|
228
227
|
executables: []
|