emp_json 1.5.0.pre.g5eec38832 → 1.5.0.pre.g6cf4f565b
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/empathy/emp_json/helpers/slices.rb +5 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11b28b325f99ceb1bc68f260a755deb077071e653fc4d33e40208864eae4ca24
|
4
|
+
data.tar.gz: 7124ff6529878a36154d44b4539b2979c9037d7918bd8c291a5f7dd923b1bc64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ad683190047a06b3350590d75a53ca96bff81dd51245716f6c1b0cc589504003b9c7640e76204b21722af0258319e3707743f841a7a1dbd8ff6b79e7fc9f7b2
|
7
|
+
data.tar.gz: 4afd4527667e7bd3488690f72a311ba9b1d31519eb841987d5c2b21a5c839f5035f1be2810957dc1db42ba14a9fe4ff29a3eba38d52531d4bc591f555c44eb11
|
data/Gemfile.lock
CHANGED
@@ -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(
|
49
|
+
slice[absolutized_id(retrieve_id(id), website_iri)] || slice[retrieve_id(id)]
|
50
50
|
end
|
51
51
|
|
52
52
|
def field_from_record(record, field)
|
@@ -56,19 +56,16 @@ module Empathy
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def retrieve_id(resource)
|
59
|
-
return
|
59
|
+
return RDF::URI(resource) if resource.is_a?(URI)
|
60
|
+
return resource if resource.is_a?(RDF::URI) || resource.is_a?(RDF::Node)
|
60
61
|
|
61
62
|
resource.try(:iri) || resource.try(:subject) || resource.try(:id) || resource
|
62
63
|
end
|
63
64
|
|
64
|
-
def retrieve_id_string(resource)
|
65
|
-
retrieve_id(resource).to_s
|
66
|
-
end
|
67
|
-
|
68
65
|
def absolutized_id(id, website_iri = nil)
|
69
|
-
return id.delete_prefix(website_iri) if website_iri.present?
|
66
|
+
return id.to_s.delete_prefix(website_iri) if website_iri.present?
|
70
67
|
|
71
|
-
id
|
68
|
+
id.to_s
|
72
69
|
end
|
73
70
|
|
74
71
|
def normalise_slice_values(values)
|