This allows deleting triples with a wildcard (nil) in the ruby bindings.
Comments?
diff -ur /home/users/aredridel/rpm/BUILD/redland-bindings-1.0.8.1/ruby/lib/rdf/redland/model.rb lib/rdf/redland/model.rb
--- /home/users/aredridel/rpm/BUILD/redland-bindings-1.0.8.1/ruby/lib/rdf/redland/model.rb	2007-04-22 20:26:14.000000000 -0600
+++ lib/rdf/redland/model.rb	2009-08-17 00:43:54.433668453 -0600
@@ -154,8 +154,16 @@
 
     # Remove the statement made of the triples (s,p,o) with the optional context Node
     def delete(s,p,o,context=nil)
-      statement = Statement.new(s,p,o)
-      self.delete_statement(statement,context)
+			if [s,p,o].all? { |e| e }
+				statement = Statement.new(s,p,o)
+				self.delete_statement(statement,context)
+			else
+				self.find(s,p,o,context) do |ds, dp, d_o|
+					st = Statement.new(ds, dp, d_o)
+					Kernel.p st
+					self.delete_statement(st, context)
+				end
+			end
     end
 
     # Remove the Statements from the Model with the given context Node

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
redland-dev mailing list
[email protected]
http://lists.librdf.org/mailman/listinfo/redland-dev

Reply via email to