rdf-lmdb 0.3.1 → 0.3.2
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/lmdb/version.rb +1 -1
- data/lib/rdf/lmdb.rb +22 -5
- 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: ea35cfcc72e22d7a71f047728b412575ce712691c2815a3693d23f94909a78b2
|
4
|
+
data.tar.gz: ab6e65528c0b9bc70bf4d18a7f47b2f47206dbfd1d09aa99c4551a799694b3a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 483d8b372297ee978595110432dd21170cd34fafde285b7f0f1269fea9d5d06428066b19e8e9b6cf294c6e71dbf378e1b30e37215e36810fae19dd6ebbeda5fc
|
7
|
+
data.tar.gz: 20fac6ce5e493fa10ef923bd12e0e549e33b83a46f859b623f5fe5838ab42348ec1ef67884bfbe7baaa396ae1937a6bb3256897f86e8fd0343b0705ac2ed423d
|
data/lib/rdf/lmdb/version.rb
CHANGED
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
|
-
|
718
|
-
|
719
|
-
|
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 =
|
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
|