emp_json 1.5.0.pre.g3c92a8018 → 1.5.0.pre.g5eec38832

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: 121becc966e6a9833e11c3c60bee8be33c16b923563ab42d16308e32f71cf95b
4
- data.tar.gz: 68eca93dbd9657472016c6a678fe119c8c969d4d34d2d160411a2b4e896d0c58
3
+ metadata.gz: 42a7ee8f987922575b898af0f2166deb5f06645a8bb6dd7af1844384883f1de1
4
+ data.tar.gz: 00e02e32f02ea629ef7d70156d2d2e911ee4e67133ee6f3a9d65e00e46711eda
5
5
  SHA512:
6
- metadata.gz: f12f1975dcf8e7d503ac784a3244fab8df777ed7e031f12700f60bd6ae625e873ca8082f3dd6bd81c784cbf3b3d0c635e8a9c083eee0969282e793cf8d4b6f9f
7
- data.tar.gz: 643f72eb86e12c1dcd5a0e4f0b3f8fe51e850bac06fd42fa4fb518673dce7ffe2f13350d9ea45deed304819d3dd6974c9702a67f212f16e361b2c0ec5bad1056
6
+ metadata.gz: 64db6485db89cac819e8bdbc31f01e925b301a23286de9df69d5335cc477c5812aae187785bc562d39c18933b911ee8886b926f83abacc85bd0845335f5d4896
7
+ data.tar.gz: d31b26826e6966a7162892f99153be3cdaaa1baf1aac5e699232487294c1d04f1b415f4a6088fd0a4bf07776ee34aea17f9d7cfbf1604b75018736fd556dcdf2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- emp_json (1.5.0.pre.g3c92a8018)
4
+ emp_json (1.5.0.pre.g5eec38832)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -46,7 +46,7 @@ module Empathy
46
46
 
47
47
  # Returns a record from a slice.
48
48
  def record_from_slice(slice, id, website_iri = nil)
49
- slice[absolutized_id(retrieve_id(id), website_iri)] || slice[retrieve_id(id)]
49
+ slice[absolutized_id(retrieve_id_string(id), website_iri)] || slice[retrieve_id_string(id)]
50
50
  end
51
51
 
52
52
  def field_from_record(record, field)
@@ -56,16 +56,19 @@ module Empathy
56
56
  end
57
57
 
58
58
  def retrieve_id(resource)
59
- return RDF::URI(resource) if resource.is_a?(URI)
60
- return resource if resource.is_a?(RDF::URI) || resource.is_a?(RDF::Node)
59
+ return resource if resource.is_a?(URI) || resource.is_a?(RDF::URI) || resource.is_a?(RDF::Node)
61
60
 
62
61
  resource.try(:iri) || resource.try(:subject) || resource.try(:id) || resource
63
62
  end
64
63
 
64
+ def retrieve_id_string(resource)
65
+ retrieve_id(resource).to_s
66
+ end
67
+
65
68
  def absolutized_id(id, website_iri = nil)
66
- return id.to_s.delete_prefix(website_iri) if website_iri.present?
69
+ return id.delete_prefix(website_iri) if website_iri.present?
67
70
 
68
- id.to_s
71
+ id
69
72
  end
70
73
 
71
74
  def normalise_slice_values(values)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emp_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0.pre.g3c92a8018
4
+ version: 1.5.0.pre.g5eec38832
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom van Kalkeren