Created
April 6, 2012 17:40
-
-
Save kasei/2321580 to your computer and use it in GitHub Desktop.
Virtuoso xsd:dateTime formatting variation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Summary: | |
Query 1 yields '2012-03-26 21:14:07.851', a xsd:dateTime value that isn't in W3CDTF | |
(no 'T' and no timezone), while Query 2 (which takes the results from Query 1 as a subquery) | |
returns '2012-03-26T21:14:07.851-05:00', a valid W3CDTF with 'T' and a timezone '-05:00'. | |
Query 1: | |
PREFIX dcterms: <http://purl.org/dc/terms/> | |
PREFIX conversion: <http://purl.org/twc/vocab/conversion/> | |
PREFIX void: <http://rdfs.org/ns/void#> | |
SELECT (MAX(?m) AS ?modified) WHERE { | |
GRAPH conversion:MetaDataset { | |
<http://logd.tw.rpi.edu/source/twc-rpi-edu/dataset/iogds-upstream> void:subset [ a conversion:VersionedDataset; dcterms:modified ?m ] | |
} | |
} | |
Result: | |
<sparql xmlns="http://www.w3.org/2005/sparql-results#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd"> | |
<head> | |
<variable name="modified"/> | |
</head> | |
<results distinct="false" ordered="true"> | |
<result> | |
<binding name="modified"><literal datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-03-26 21:14:07.851</literal></binding> | |
</result> | |
</results> | |
</sparql> | |
Query 2: | |
PREFIX dcterms: <http://purl.org/dc/terms/> | |
PREFIX conversion: <http://purl.org/twc/vocab/conversion/> | |
PREFIX void: <http://rdfs.org/ns/void#> | |
CONSTRUCT { <s> <p> ?modified } WHERE { | |
{ | |
SELECT (MAX(?m) AS ?modified) WHERE { | |
GRAPH conversion:MetaDataset { | |
<http://logd.tw.rpi.edu/source/twc-rpi-edu/dataset/iogds-upstream> void:subset [ a conversion:VersionedDataset; dcterms:modified ?m ] | |
} | |
} | |
} | |
} | |
Results: | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | |
<s> <p> "2012-03-26T21:14:07.851-05:00"^^xsd:dateTime . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment