rdf-lmdb 0.3.1 → 0.3.2

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: 3974d6238f7b35ae6d58d500fd35e3ffe3b927621b9a83d433352576dc6f4f01
4
- data.tar.gz: a4bb3618b788f8ad2e79a92d0eec78860a6a4c76b1f4e83dc330b0302878b0e8
3
+ metadata.gz: ea35cfcc72e22d7a71f047728b412575ce712691c2815a3693d23f94909a78b2
4
+ data.tar.gz: ab6e65528c0b9bc70bf4d18a7f47b2f47206dbfd1d09aa99c4551a799694b3a0
5
5
  SHA512:
6
- metadata.gz: '09e1cfa5e90ba6834a7f8c76fc310e1d89d7adacc22d20deb77295c8d128a9e48325d9f6a4174bab56c73803e654ef3a04c0a418928e2f56dca6ac4b0caef459'
7
- data.tar.gz: 8e778b125ead8e2bd8cf5c3a695b00c499e1e6a3d6e8e98da8de9f273cb5e75558942e66646fdf2301b4d24ae5ede4ae34209c3be5a311c04faffa692e288e5f
6
+ metadata.gz: 483d8b372297ee978595110432dd21170cd34fafde285b7f0f1269fea9d5d06428066b19e8e9b6cf294c6e71dbf378e1b30e37215e36810fae19dd6ebbeda5fc
7
+ data.tar.gz: 20fac6ce5e493fa10ef923bd12e0e549e33b83a46f859b623f5fe5838ab42348ec1ef67884bfbe7baaa396ae1937a6bb3256897f86e8fd0343b0705ac2ed423d
@@ -1,5 +1,5 @@
1
1
  module RDF
2
2
  module LMDB
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
data/lib/rdf/lmdb.rb CHANGED
@@ -688,7 +688,10 @@ Currently you have to dump from the old layout and reload the new one. Sorry!
688
688
  end
689
689
 
690
690
  def delete_statement statement
691
+ # note that this does not get called by `delete_statements`,
692
+ # because we want the transaction on the outside.
691
693
  complete! statement
694
+ # warn "WTF LOL #{statement.inspect}"
692
695
  @lmdb.transaction do |t|
693
696
  if statement.variable?
694
697
  query(statement).each { |stmt| rm_one stmt }
@@ -714,12 +717,25 @@ Currently you have to dump from the old layout and reload the new one. Sorry!
714
717
  def delete_statements statements
715
718
  @lmdb.transaction do |t|
716
719
  hashes = []
717
- statements.each do |statement|
718
- complete! statement
719
- hashes += rm_one statement, scan: false
720
+
721
+ # we don't know what's in here but it may contain statements
722
+ # with variables, in which case we have to handle them
723
+ enums = [statements]
724
+ # also note that RDF::Util::Coercions#coerce_statements
725
+ # which is called in advance of this is supposed to take
726
+ # care of this situation but doesn't for some reason.
727
+ until enums.empty?
728
+ statements = enums.shift
729
+ statements.each do |statement|
730
+ if statement.variable?
731
+ enums << query(statement)
732
+ else
733
+ hashes += rm_one statement, scan: false
734
+ end
735
+ end
720
736
  end
721
737
 
722
- clean_terms hashes
738
+ clean_terms hashes.uniq
723
739
  t.commit
724
740
  end
725
741
 
@@ -818,7 +834,8 @@ Currently you have to dump from the old layout and reload the new one. Sorry!
818
834
  # end
819
835
 
820
836
  def delete_insert deletes, inserts
821
- ret = super(deletes, inserts)
837
+ ret = nil
838
+ @lmdb.transaction { ret = super(deletes, inserts) }
822
839
  commit_transaction # this is to satiate the test suite
823
840
  ret
824
841
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-lmdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Taylor