Integers and Datetime literals in RDF XML

rdf, semantic-web, triplestore

Solution

Easy (but verbose):

<exif:FocalLength rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">50</exif:FocalLength>

See this section in the RDF/XML spec

Problem

I've started to toy around with triplestores and RDF to store image metadata, but I can't understand how to put integer values into RDF/XML. ``` <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exif="http://penkov.me/exif/"> <rdf:Description rdf:about="http://penkov.me/images/0"> <exif:SourceFile>./205CANON/_MG_0538.CR2</exif:SourceFile> <exif:Make>Canon</exif:Make> <exif:FocalLength>50</exif:FocalLength> </rdf:Description> </rdf:RDF> ``` I guess `50` in `<exif:FocalLength>` tag will be treated as a string by a triplestore and it wouldn't be possible to make range queries about this value.

Original source