login/register

Snip!t from collection of Alan Dix

see all channels for Alan Dix

Snip
summary

RDF datatypes are based on XSD datatypes, which are ofte... Unfortunately, most implementations simply have the XSD ... do not support or validate new datatype descriptions (th... sord_validate can). Regardless, it is sometimes necessar... datatype wi

How to define a datatype in RDF | drobilla.net
http://drobilla.net/2012/09/08/how-to-define-a-datatype-in-rdf/

Categories

/Channels/techie/RDF

[ go to category ]

For Snip

loading snip actions ...

For Page

loading url actions ...

RDF datatypes are based on XSD datatypes, which are often used directly. Unfortunately, most implementations simply have the XSD types baked in and do not support or validate new datatype descriptions (though at least sord_validate can). Regardless, it is sometimes necessary to define a datatype with a specific restriction so it can be machine validated. It’s a bit tricky to figure out how to do this, since everything is buried in specifications that aren’t as triple oriented as they should be. So, here is an example of defining a datatype restricted by regular expression in Turtle, derived from the OWL documentation:

HTML

RDF datatypes are based on <a href="http://www.w3.org/TR/xmlschema11-2/">XSD datatypes</a>, which are often used directly. Unfortunately, most implementations simply have the XSD types baked in and do not support or validate new datatype descriptions (though at least <a href="http://drobilla.net/software/sord"><code>sord_validate</code></a> can). Regardless, it is sometimes necessary to define a datatype with a specific restriction so it can be machine validated. It&#x2019;s a bit tricky to figure out how to do this, since everything is buried in specifications that aren&#x2019;t as triple oriented as they should be. So, here is an example of defining a datatype restricted by regular expression in Turtle, derived from the OWL documentation: