[redland-dev] Problem: removing triple without specifying triple's object

Roman Bischoff Roman.Bischoff at gmx.ch
Tue Jul 19 09:37:45 BST 2005


Hi,

I want to do CRUD of RDF statements via HTML forms and CGI using Redland's
Python bindings. The 'Create' and 'Read' operations work quite well so far.

For updating the object node of a certain RDF triple (defined by
subject_node, predicate_node and context_node), it seems that I need first
to delete the existing RDF triple, and add afterwards a new triple.
(otherwise there are multiple RDF triples with the same subject, predicate
and different object and same context in the triplestore)

So far I couldn't remove RDF statements from the model when using "None" as
object node. (using the object's literal value works)

I intend to use "None" as object node, because I want to remove (i.e.
update) this type of statement before adding a now one, regardless of the
currently existing (literal) value for the object node.

my two questions:

1) is it generally possible to use "None" as object node when deleting
statements from a model?

2) how to do it in Python?

delst = RDF.Statement(subj_node, predicate_node, None)
del rdfmodel[delst, context_node]

==> doesn't work.

delst = RDF.Statement(subj_node, predicate_node, "0123456")
del rdfmodel[delst, context_node]

==> works fine.

(I use: Python 2.4.1, Debian 1:3.3.5-8ubuntu2, librdf 1.0.2-1ubuntu1)

Thanks for any help

Regards,
Roman

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl


More information about the redland-dev mailing list