solis 0.121.0 → 0.122.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: e8125aeb13e491c0d44821cca3c243754167473029057f2603455f7c8794a43b
4
- data.tar.gz: 28f39b6a84d9cdb20a7f2a57729f570f2b0aa56a84d0a7864ad8a15a108e57b7
3
+ metadata.gz: 02e35b7cfb4fd0efe75a619eb1261dabde1d6ea130ba4508fb4bac17a644207b
4
+ data.tar.gz: f04e921636d9aed215883796f83904cc24a618d3c8f7697ef2f691ca3e7768fa
5
5
  SHA512:
6
- metadata.gz: 66ee13e892ee4bcfd1d2d8c762a6dc9f014a1cee03339e3440bdad93fc8197550ef9c609993326193a611b8ef86d48d1c17c2d90e7d2b5d46bfa396f08b3015e
7
- data.tar.gz: 351b8b1a0cb8939398f77ae05df71188dd844adb84424cb5a1abe453261e30a86c1d90f3293d3b1598d2acbb0f8052197fd0d5c01559fa257ebbf80f5ee4cdb3
6
+ metadata.gz: 4e22f052c08a4e7cebcb2c78a114b752d2fe00ee898caf1e23d9331aef19cf55aa4616501bcfe0684c048e8f232e2d7304973368a5b6006321fb6ccd41ab9e55
7
+ data.tar.gz: d27220cf49606664cc05aacbad1d8f67a1282c0badb5bae1017535888ebf952ca87da6f2de48309f50bd058ffa97b4bd6342a5369193892fc8c25eab70ca9b0e
data/lib/solis/model.rb CHANGED
@@ -250,7 +250,12 @@ values ?s {<#{self.graph_id}>}
250
250
  id = attributes.delete('id')
251
251
  sparql = sparql_client || SPARQL::Client.new(self.class.sparql_endpoint)
252
252
 
253
- original_klass = prefetched_original || self.query.filter({ language: self.class.language, filters: { id: [id] } }).find_all.map { |m| m }&.first
253
+ original_klass = prefetched_original
254
+ # A prefetched original may be an id-only stub (embedded relations are loaded that
255
+ # way by Query#graph_to_object). It cannot seed updated_klass — omitted mandatory
256
+ # attributes would be lost — so re-load the full entity from the store.
257
+ original_klass = nil if original_klass && shallow_stub?(original_klass)
258
+ original_klass ||= self.query.filter({ language: self.class.language, filters: { id: [id] } }).find_all.map { |m| m }&.first
254
259
  raise Solis::Error::NotFoundError if original_klass.nil?
255
260
  updated_klass = original_klass.deep_dup
256
261
 
@@ -833,18 +838,6 @@ values ?s {<#{self.graph_id}>}
833
838
  end
834
839
 
835
840
  def make_graph(graph, hierarchy, id, klass, klass_metadata, resolve_all, known_entities = {}, skip_store_fetch: false)
836
- # klass may arrive as an id-only stub (embedded relation from Query#graph_to_object,
837
- # or passed via prefetched_original). Resolve it to the full stored entity once so
838
- # every attribute is emitted into the graph.
839
- if !skip_store_fetch && shallow_stub?(klass)
840
- uuid = id.value.split('/').last
841
- fetched = klass.query.filter({ filters: { id: [uuid] } }).find_all { |f| f.id == uuid }.first
842
- unless fetched.nil?
843
- klass = fetched
844
- known_entities[uuid] = fetched
845
- end
846
- end
847
-
848
841
  klass_metadata[:attributes].each do |attribute, metadata|
849
842
  data = klass.instance_variable_get("@#{attribute}")
850
843
 
data/lib/solis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Solis
2
- VERSION = "0.121.0"
2
+ VERSION = "0.122.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.121.0
4
+ version: 0.122.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Celik