sparql - Compare temporal variables in virtuoso -
I work on virtuoso and receive a problem with comparison of the temporary variable
My data is in a ttl file, very simple, as follows:
@prefix attr: & lt; Http: //my.com/attr_> . @Prinfix: & lt; Http: //my.com/> . @PrinxXSD: & lt; Http: //www.w3.org/2001/XMLSchema#> . : T99255 Atri: TS "2007-01-14 20:01:55" ^ ^ XSD: Datetime: T 99255 At: Te "2008-10-04 14:33:09" ^ ^ XSD: Datetime: T 99257 atr : TS "2009-05-02 04:35:11" ^ ^ XSD: Datetime: T 99257 Att: Te "2099-12-31 15:59:59" ^ ^ XSD: Datetime
Then I load it in a graph by the name of the test. I run the query "choose sparql 'from where {? S? P? O};" And get up to 4 records.
However, when I run the following query:
sparql PREFIX: & lt; Http: //my.com/> PREFIX attr: & lt; Http: //my.com/attr_> PREFIX xsd: & lt; Http: //www.w3.org/2001/XMLSchema#> Choose? Triple_0? T_T? By T_AT & lt; Gstest & gt; WHERE {{triple_0 attr: ts? T_ts}? Triple_0 at: To? T_AT Filter (? T_ts & lt ;? T_te)};
I only found one result of "T 99255" of the same result. I think the problem is that "20 99-12-31 15:59:59" There is no valid date time for VATUsuos, so I replace "2099" with "2020", then I have two records See you here.
Any value assumes xsd: dateTime in virtuoso?
Thanks
syntax issues
if it really is Your data is:
@ prefix atter: & lt; Http: //my.com/attr_> . @Prinfix: & lt; Http: //my.com/> . @prefix rdfs: & lt; Http: //www.w3.org/2000/01/rdf-schema#> . : T99255 Atri: TS "2007-01-14 20:01:55" ^ ^ XSD: Datetime: T 99255 At: Te "2008-10-04 14:33:09" ^ ^ XSD: Datetime: T 99257 atr : TS "2009-05-02 04:35:11" ^ ^ XSD: Datetime: T 99257 Att: Te "2099-12-31 15:59:59" ^ ^ XSD: Datetime
Then you probably will not be able to load it, because it does not declare the xsd:
prefix. Maybe you can not actually load any data. Do you get results from a question such as select * where? S? P? O}
?
Graph Names Issues
Then I load this test in an article called
Your code, however,
SELECT? Triple_0? T_ts? T_te FROM & lt; Gstest & gt;
This can be a problem. To make sure you select
? G? S? P? O where {graph? G {? S? P? O}}
You can try triplets in the graph.
About the query and the comparison
You do not need to change the values that are already datasets for datasets, instead of
FILTER (xsd: dateTime (? T_ts)
You can: ? T_ts and T_te For each of the bind
, and returns only the sequential combinations: Choose
FILTER (? T_ts & lt ;? T_te)
? T_ts? T_te Where {values? T_ts {"2007-01-14 20:01: 55" ^^ XSD: Datetime "2008-10-04 14:33:09" ^ ^ XSD: Datetime "2009-05-02 04:35:11" ^ ^ Xsd: datetime "2099-12-31 15:59: 59" ^^ xsd: dateTime} value? T_te {"2007-01-14 20:01:55" ^ x xd: date time "2008-10-04 14:33:09" ^ x xd: date time "2009-05-02 04:35:11" Order by ^^ xsd: dateTime "2099-12-31 15:59:59" ^ ^ xsd: dateTime} filter (? T_ts & lt ;? T_te)}? T_ts? T_te
t_ts t_te -------------------------- --- ----------------------- 2007-01-14 T20: 01: 55 + 02: 00 2008-10-04 T 14:33 : 09 + 02: 00 2007-01-14 T20: 01: 55 + 02: 00 2009-05-02 TT4: 35: 11 + 02: 00 2007-01-14 T20: 01: 55 + 02: 00 2099-12-31 T15: 59: 59 + 02: 00 2008-10-04 T 14: 33: 09 + 02: 00 2009-05-02 -04: 35: 11 + 02: 00-10-2008-10- 04 T 14: 33: 09 +02: 00 2099-12-31 T15: 59: 59 + 02: 00 2009-05-02T04: 35: 11 + 02: 00 2099-12-31 T15: 59: 59 + 02: 00
These are the results when I run that query in DBipedia, which is going on in the establishment of virtuoso.
Comments
Post a Comment