solis 0.84.0 → 0.86.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2980fd83ee3bd59017c9831136d40f24402c80c3591578b27d3cc03ad132b90
4
- data.tar.gz: 248019990f65b20f0bfb2b605f868c2658b002e02db3c5a61a7657d83e071bd0
3
+ metadata.gz: 7970257cfdc060571c01b55b557d8146d536dbb52455b456a82f01e7b6482363
4
+ data.tar.gz: f6a0cf69a9aab6fddede73a70832c4ba97968ffdaae9fda244f2b9a9881b7a88
5
5
  SHA512:
6
- metadata.gz: 720dd30ae84033d977cf04f6d6736745f24d8b32b06b3dedd01e09c05d5f72726a6ee2f2c74249ea8e87bc1bde8daf9bd2fe810bf139dc8d48e8ff70c7dd611d
7
- data.tar.gz: 82855397f33cf99f61f6a7d53b3939035305f0570b2ee7965ca353402891d6b752351d19c414c2a3ee74bda22e7774a3f70f7d223b2f974c0c227610307e41a1
6
+ metadata.gz: b0ae8c97bdfd0420a3679797bb23c63990a6814cb341b549642766ed7a48b83a482b2599c34c414925049185c3593bbb1281960603fa4473a602be9cd5ab6aa3
7
+ data.tar.gz: 1426ecf0a1dead864cc82afde451bddf40136e6d447a106034689fc51807338eee411f3ac3fe18f92d88581a699fdb2caf27990d6c325fb200ae48f5e5d4f184
data/lib/solis/model.rb CHANGED
@@ -192,6 +192,7 @@ values ?s {<#{self.graph_id}>}
192
192
  id = attributes.delete('id')
193
193
 
194
194
  sparql = SPARQL::Client.new(self.class.sparql_endpoint)
195
+ #sparql = Solis::Store::Sparql::Client.new(self.class.sparql_endpoint, self.class.graph_name)
195
196
 
196
197
  original_klass = self.query.filter({ language: nil, filters: { id: [id] } }).find_all.map { |m| m }&.first
197
198
  raise Solis::Error::NotFoundError if original_klass.nil?
@@ -274,10 +275,12 @@ values ?s {<#{self.graph_id}>}
274
275
  after_update_proc&.call(updated_klass, data)
275
276
 
276
277
  data
278
+ #rescue EOFError => e
277
279
  rescue StandardError => e
278
280
  original_graph = as_graph(original_klass, false)
279
281
  Solis::LOGGER.error(e.message)
280
282
  Solis::LOGGER.error original_graph.dump(:ttl)
283
+ Solis::LOGGER.error delete_insert_query
281
284
  sparql.insert_data(original_graph, graph: original_graph.name)
282
285
 
283
286
  raise e
@@ -308,6 +311,10 @@ values ?s {<#{self.graph_id}>}
308
311
  end
309
312
  LOGGER.info("ID(#{id}) generated for #{self.name} in #{id_retries} retries") if ConfigFile[:debug]
310
313
  model.instance_variable_set("@id", id)
314
+ elsif id.to_s =~ /^https?:\/\//
315
+ id = id.to_s.split('/').last
316
+ LOGGER.info("ID(#{id}) normalised for #{self.name}") if ConfigFile[:debug]
317
+ model.instance_variable_set("@id", id)
311
318
  end
312
319
  model
313
320
  rescue StandardError => e
@@ -499,16 +506,7 @@ values ?s {<#{self.graph_id}>}
499
506
  raise Solis::Error::InvalidAttributeError, "#{hierarchy.join('.')}~#{klass.name}.#{attribute} min=#{metadata[:mincount]} and max=#{metadata[:maxcount]}" if data.nil?
500
507
  end
501
508
 
502
- if data.nil? && metadata.key?(:maxcount) && ( metadata[:maxcount].nil? || metadata[:maxcount] > 0) && graph.query(RDF::Query.new({ attribute.to_sym => { RDF.type => metadata[:node] } })).size == 0
503
- if data.nil?
504
- uuid = id.value.split('/').last
505
- original_klass = klass.query.filter({ filters: { id: [ uuid ] } }).find_all { |f| f.id == uuid }.first || nil
506
- unless original_klass.nil?
507
- klass = original_klass
508
- data = klass.instance_variable_get("@#{attribute}")
509
- end
510
- end
511
- #if data is still nil
509
+ if data && metadata.key?(:maxcount) && ( metadata[:maxcount] && metadata[:maxcount] > 0) && graph.query(SPARQL.parse("select (count(?s) as ?max_subject) where { ?s #{self.class.graph_prefix}:#{attribute} ?p}")).first.max_subject > metadata[:maxcount].to_i
512
510
  raise Solis::Error::InvalidAttributeError, "#{hierarchy.join('.')}~#{klass.name}.#{attribute} min=#{metadata[:mincount]} and max=#{metadata[:maxcount]}" if data.nil?
513
511
  end
514
512
 
data/lib/solis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Solis
2
- VERSION = "0.84.0"
2
+ VERSION = "0.86.0"
3
3
  end
data/solis.gemspec CHANGED
@@ -42,6 +42,7 @@ Gem::Specification.new do |spec|
42
42
  spec.add_runtime_dependency 'psych', '~> 5.1'
43
43
  spec.add_runtime_dependency 'csv'
44
44
  spec.add_runtime_dependency 'mutex_m'
45
+ spec.add_runtime_dependency 'ostruct'
45
46
  # spec.add_runtime_dependency 'rdf-edtf', '~> 1.1.2'
46
47
 
47
48
  spec.add_development_dependency 'rake', '~> 13.0'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.84.0
4
+ version: 0.86.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Celik
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-24 00:00:00.000000000 Z
10
+ date: 2025-04-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -219,6 +219,20 @@ dependencies:
219
219
  - - ">="
220
220
  - !ruby/object:Gem::Version
221
221
  version: '0'
222
+ - !ruby/object:Gem::Dependency
223
+ name: ostruct
224
+ requirement: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ type: :runtime
230
+ prerelease: false
231
+ version_requirements: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: '0'
222
236
  - !ruby/object:Gem::Dependency
223
237
  name: rake
224
238
  requirement: !ruby/object:Gem::Requirement