rdf-kv 0.1.6 → 0.1.7
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 +4 -4
- data/lib/rdf/kv/version.rb +1 -1
- data/lib/rdf/kv.rb +7 -2
- 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: c5ff7772af99313abdd510adc72998063277173d7fa2c63b5c410c155c141e1c
|
4
|
+
data.tar.gz: a94c0a32c8e15d2f1406f89ed595994b5274de9b87721d55629c1cf043468b74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a69f88f0b16744f704364ccf8be32c575237752247ef60bf12121a0004a0e848a6c008d54435b0d1267a8f0ea6bd8d61efefe27549050bf4875ebd0fbf21e558
|
7
|
+
data.tar.gz: ccd23bce3d5df3a94607a0dcc9c92920070b3a4c847dbb71807889d364e40fc6a190ef3bff3650c201bb06a0b2fcba3f669cb25b40b9a38ac4e2fd504be238ca
|
data/lib/rdf/kv/version.rb
CHANGED
data/lib/rdf/kv.rb
CHANGED
@@ -210,6 +210,8 @@ class RDF::KV
|
|
210
210
|
done
|
211
211
|
end
|
212
212
|
|
213
|
+
# XXX THIS FUNCTION SUCKS
|
214
|
+
|
213
215
|
# unconditionally return a uri or bnode
|
214
216
|
def resolve_term term
|
215
217
|
return term if term.is_a? RDF::Term
|
@@ -243,7 +245,7 @@ class RDF::KV
|
|
243
245
|
elsif hint == ?@
|
244
246
|
term = RDF::Literal(token, language: langdt.to_s.to_sym)
|
245
247
|
elsif hint == ?^
|
246
|
-
raise 'datatype must be an RDF::Resource' unless
|
248
|
+
raise ArgumentError, 'datatype must be an RDF::Resource' unless
|
247
249
|
langdt.is_a? RDF::Resource
|
248
250
|
term = RDF::Literal(token, datatype: langdt)
|
249
251
|
elsif hint == ?'
|
@@ -382,7 +384,9 @@ class RDF::KV
|
|
382
384
|
end
|
383
385
|
|
384
386
|
%i[term1 term2 graph].filter { |t| contents[t] }.each do |which|
|
385
|
-
|
387
|
+
tmp = resolve_term contents[which]
|
388
|
+
tmp = callback.call(tmp) if callback
|
389
|
+
contents[which] = tmp
|
386
390
|
end
|
387
391
|
|
388
392
|
# these are the values we actually use; ensure they are duplicated
|
@@ -403,6 +407,7 @@ class RDF::KV
|
|
403
407
|
else
|
404
408
|
s, p = (contents[:term2] ? contents.values_at(:term1, :term2) :
|
405
409
|
[subject, contents[:term1]]).map do |t|
|
410
|
+
# XXX DO WE NEED THIS ANYMORE??
|
406
411
|
t = resolve_term t
|
407
412
|
callback ? callback.call(t) : t
|
408
413
|
end
|