[redland-dev] RDF.Node with a datatype

Dave Beckett dave at dajobe.org
Tue Feb 23 18:49:41 CET 2010



On Sat, 20 Feb 2010, Uldis Bojars wrote:
> Hi,
>
> Redland Python bindings (v.1.0.10.1) report the following exception
> when constructing a RDF.Node. Is that a bug?
>
> import RDF
> xsd = RDF.NS("http://www.w3.org/2001/XMLSchema#")
> RDF.Node("2009", datatype=xsd.date)
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
>
> /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/RDF.py
> in __init__(self, arg, **args)
>    302         datatype=args['datatype']
>    303
> self._node=Redland.librdf_new_node_from_typed_literal(_world._world,
> --> 304           args['literal'], xml_language, datatype._reduri)
>    305       else:
>    306         self._node=Redland.librdf_new_node_from_literal(_world._world,
>
> AttributeError: 'Node' object has no attribute '_reduri'

Looks like a type error to me; datatype should be a Redland.Uri,
which does have a _reduri attribute.

If somebody wants to suggest pythoninc ways to test for this, please
submit a patch :)

Dave



More information about the redland-dev mailing list