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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b72d0ee932d9e26c01124abcf4534267568729821d046ac965a5919f2dc664a1
4
- data.tar.gz: b6bcf2e28c9773f1a863b86f102759941c430bf928fdb9bd46738f08d4012612
3
+ metadata.gz: c5ff7772af99313abdd510adc72998063277173d7fa2c63b5c410c155c141e1c
4
+ data.tar.gz: a94c0a32c8e15d2f1406f89ed595994b5274de9b87721d55629c1cf043468b74
5
5
  SHA512:
6
- metadata.gz: ffe573b6c92677c11b3549902166230f963afc66ebe466d8f9dd258bf319787d778dbc421b40d494298d616a166d41d1a9cd87e5e731ae375e56121de43946b8
7
- data.tar.gz: 589625778838b23b2f5649f8d8f3e9d9b7949a458f1852e3aed63ecc444ccba5895a53cf4e196d02db2f096404bb71ca530d56d7c89732ad68888c2c68e78bb9
6
+ metadata.gz: a69f88f0b16744f704364ccf8be32c575237752247ef60bf12121a0004a0e848a6c008d54435b0d1267a8f0ea6bd8d61efefe27549050bf4875ebd0fbf21e558
7
+ data.tar.gz: ccd23bce3d5df3a94607a0dcc9c92920070b3a4c847dbb71807889d364e40fc6a190ef3bff3650c201bb06a0b2fcba3f669cb25b40b9a38ac4e2fd504be238ca
@@ -1,5 +1,5 @@
1
1
  module RDF
2
2
  class KV
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.7"
4
4
  end
5
5
  end
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
- contents[which] = resolve_term contents[which]
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-kv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Taylor