ropensci / redland-bindings

Redland librdf language bindings
http://librdf.org/bindings/
Other
17 stars 3 forks source link

Add ability to specify datatype uri for literal nodes #17

Closed gothub closed 9 years ago

gothub commented 9 years ago

Currently Node objects of type 'literal' can have an associated datatype by appending the datatype to the literal string, i.e.

object <- new("Node", world, literal="John Smith^^xsd:string")

which would be serialized as:

<dc:creator>John Smith^^xsd:string</dc:creator>

Node will be updated to allow specifying a uri associated with the literal, not appended to the actual literal:

object <- new("Node", world, literal="John Smith", datatype_uri="http://www.w3.org/2001/XMLSchema#string")

This would be serialized as:

<dc:creator rdf:datatype="http://www.w3.org/2001/XMLSchema#string">John Smith</dc:creator>

gothub commented 9 years ago

Added in commit 7b11ab1d1d7e586902e9da21c08a48598ed55038