[redland-dev] Bug(s) in Python binding.

Arjan Wekking a.wekking at synantics.nl
Sat Apr 19 20:01:16 BST 2003


On line 289 of python/RDF.py, 
Redland.librdf_node_get_literal_value_datatype() is used while the C API 
docs only has librdf_node_get_literal_value_datatype_uri(). This 
function is used in the Node::get_literal_value(self) method.

Replacing line 289:
'datatype': Redland.librdf_node_get_literal_value_datatype(self._node)

With:
'datatype':  
Uri(from_object=Redland.librdf_node_get_literal_value_datatype_uri(self._node))

Should work, if the C function 
"librdf_node_get_literal_value_datatype_uri 
<http://www.redland.opensource.ac.uk/docs/api/r3397.html>" was being 
wrapped by Swig in python/Redland_wrap.c (which it isnt, so I can't test 
it by modifying RDF.py alone), but whether the datatype should be an Uri 
instance or a string is up to whomever fixes this in CVS.

Furthermore,  I have encountered other strange errors using the Model 
instance and it's find_statements() function using an incomplete 
Statement (?, rdf:type, ?) whose statements contained blank nodes, but 
that might just be me using the Statement methods wrong, I'll try to 
recreate the errors in a simple testcase later.

Greetings,
-Arjan

-- 
Arjan Wekking
email a.wekking at synantics.nl
------------------------------------------------
http://www.synantics.com/
------------------------------------------------
Synantics B.V.          phone   +31 78 6 144 211
Postbus 537             fax     +31 78 6 144 939
3300 AM Dordrecht       email info at synantics.com
------------------------------------------------ 





More information about the redland-dev mailing list