solis 0.66.0 → 0.68.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
  SHA256:
3
- metadata.gz: 9dd4e75e587fdb57f0fecc1a80921fc36811e3cd9f90e969a5f4f519a82e9d50
4
- data.tar.gz: bed2e9f59938c44df66336947b97a6f059182d24f10c6f49f8c2988d18e5a755
3
+ metadata.gz: a93afb01da132bf005f3e682986c2e15876db706550f579aa5505854c23aabb0
4
+ data.tar.gz: 6ab988794791e1e14abeb58c8ed610270685cef642135d49fe679248396186fa
5
5
  SHA512:
6
- metadata.gz: b58e3d6d1c1dd065e23de313a2b362b90467a50ed460b2759c1fb1f217ceae1ccbe27cf91f436a952918d6b65a4e8b26d6f2d3504b89737383da28debeffde38
7
- data.tar.gz: b8ac1314cc209a8143b71eafae4fea6e7e940bec918190beeb62c6db0950a3937ee64fe5993b8b8166a812a09ad67b9fd3057da7c12dc5eb7e3ea08e82f51489
6
+ metadata.gz: 7fd19bea2aa49407929aecb36760e7cf1ae31896e57c6075f43dd09ef8abd56e4f4cf15643f031ed9e5537f9249d7e3d50c10a7f8aff8d1b08138623ca729a42
7
+ data.tar.gz: 3bad39506d27b3cf9437c27e1a9c99a9fcd7cdcc78a50cdd1c951ef80741926e5db1ab189835a68c3a80ec2323f69500b39156c1ea99a792143583fe95b43dd1
data/lib/solis/graph.rb CHANGED
@@ -277,14 +277,14 @@ module Solis
277
277
  remote_resources = [remote_resources] unless remote_resources.is_a?(Array)
278
278
  remote_resources = remote_resources.map do |remote_resource|
279
279
  resource_id = remote_resource.id =~ /^http/ ? remote_resource.id.split('/').last : remote_resource.id
280
- #"/#{key.tableize}/#{resource_id}"
280
+
281
281
  "#{resource.class.graph_name.gsub(/\/$/,'')}/#{belongs_to_resource_name.tableize}/#{resource_id}"
282
282
  end
283
283
 
284
- # return remote_resources.length == 1 ? remote_resources.first : remote_resources
285
284
  end
286
285
 
287
- remote_resources.first if remote_resources #belongs_to
286
+
287
+ remote_resources.join(',') if remote_resources #belongs_to
288
288
  end
289
289
  end
290
290
  else
@@ -323,7 +323,7 @@ module Solis
323
323
 
324
324
  #return remote_resources.length == 1 ? remote_resources.first : remote_resources
325
325
  end
326
- remote_resources.first if remote_resources
326
+ remote_resources.join(',') if remote_resources
327
327
  end
328
328
  end
329
329
  end
data/lib/solis/model.rb CHANGED
@@ -23,6 +23,17 @@ module Solis
23
23
  if self.class.metadata[:attributes][attribute.to_s][:node_kind].is_a?(RDF::URI) && value.is_a?(Hash)
24
24
  inner_model = self.class.graph.shape_as_model(self.class.metadata[:attributes][attribute.to_s][:datatype].to_s)
25
25
  value = inner_model.new(value)
26
+ elsif self.class.metadata[:attributes][attribute.to_s][:node_kind].is_a?(RDF::URI) && value.is_a?(Array)
27
+ new_value = []
28
+ value.each do |v|
29
+ if v.is_a?(Hash)
30
+ inner_model = self.class.graph.shape_as_model(self.class.metadata[:attributes][attribute.to_s][:datatype].to_s)
31
+ new_value << inner_model.new(v)
32
+ else
33
+ new_value << v
34
+ end
35
+ end
36
+ value = new_value
26
37
  end
27
38
 
28
39
  # switched off. currently language query parameters returns the value
@@ -139,7 +150,7 @@ module Solis
139
150
 
140
151
  sparql = SPARQL::Client.new(self.class.sparql_endpoint)
141
152
 
142
- original_klass = self.query.filter({language: nil, filters: { id: [id] } }).find_all.map { |m| m }&.first
153
+ original_klass = self.query.filter({ language: nil, filters: { id: [id] } }).find_all.map { |m| m }&.first
143
154
  raise Solis::Error::NotFoundError if original_klass.nil?
144
155
  updated_klass = original_klass.deep_dup
145
156
 
@@ -400,11 +411,11 @@ module Solis
400
411
 
401
412
  data.each do |d|
402
413
  if defined?(d.name) && self.class.graph.shape?(d.name)
403
- if self.class.graph.shape_as_model(d.name.to_s).metadata[:attributes].select{|_,v| v[:node_kind].is_a?(RDF::URI)}.size > 0 &&
404
- hierarchy.select{|s| s =~ /^#{d.name.to_s}/}.size == 0
414
+ if self.class.graph.shape_as_model(d.name.to_s).metadata[:attributes].select { |_, v| v[:node_kind].is_a?(RDF::URI) }.size > 0 &&
415
+ hierarchy.select { |s| s =~ /^#{d.name.to_s}/ }.size == 0
405
416
  internal_resolve = false
406
417
  d = build_ttl_objekt2(graph, d, hierarchy, internal_resolve)
407
- elsif self.class.graph.shape_as_model(d.name.to_s) && hierarchy.select{|s| s =~ /^#{d.name.to_s}/}.size == 0
418
+ elsif self.class.graph.shape_as_model(d.name.to_s) && hierarchy.select { |s| s =~ /^#{d.name.to_s}/ }.size == 0
408
419
  internal_resolve = false
409
420
  d = build_ttl_objekt2(graph, d, hierarchy, internal_resolve)
410
421
  else
data/lib/solis/query.rb CHANGED
@@ -321,7 +321,11 @@ PREFIX #{@model.class.graph_prefix}: <#{@model.class.graph_name}>"
321
321
  end
322
322
  else
323
323
  if solution_model.metadata[:attributes][attribute][:maxcount].nil? || solution_model.metadata[:attributes][attribute][:maxcount] > 1
324
- data[attribute] = [object]
324
+ if data.include?(attribute)
325
+ data[attribute] << object
326
+ else
327
+ data[attribute] = [object]
328
+ end
325
329
  else
326
330
  data[attribute] = object
327
331
  end
data/lib/solis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Solis
2
- VERSION = "0.66.0"
2
+ VERSION = "0.68.0"
3
3
  end
data/solis.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ['Mehmet Celik']
7
7
  spec.email = ['mehmet@celik.be']
8
8
 
9
- spec.summary = 'Creates a SHACL, RDF, PlantUML file from a Google sheet and a layer ontop of a data store(RDBMS, Triple store)'
9
+ spec.summary = 'Turn any SHACL file into an API, ORM, documentation, ...'
10
10
  spec.description = 'The SUN in latin or is it SILOS spelled backwards. Creates a SHACL, RDF, PlantUML file from a Google sheet and a layer ontop of a data store(RDBMS, Triple store)'
11
11
  spec.homepage = 'https://github.com/mehmetc/solis'
12
12
  spec.license = 'MIT'
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.66.0
4
+ version: 0.68.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-10-20 00:00:00.000000000 Z
11
+ date: 2022-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -299,6 +299,5 @@ requirements: []
299
299
  rubygems_version: 3.1.6
300
300
  signing_key:
301
301
  specification_version: 4
302
- summary: Creates a SHACL, RDF, PlantUML file from a Google sheet and a layer ontop
303
- of a data store(RDBMS, Triple store)
302
+ summary: Turn any SHACL file into an API, ORM, documentation, ...
304
303
  test_files: []