SPARQL query issue with xsd:dateTime

146 views
Skip to first unread message

Iker Esnaola

unread,
Sep 5, 2016, 4:22:06 AM9/5/16
to rm...@googlegroups.com

Hi everybody,

I am using the LOD 1.5.12 version, along with the RapidMiner Studio 7.1.0. version.

I am having problems inserting queries related with dateTimes in the SPARQL Data Importer module. My query is the following one:

SELECT * 
FROM <urn:calendarData>
WHERE {
  ?instant  <
http://www.w3.org/2006/time#hasDateTimeDescription> ?dtdesc.
  ...
  ?dtdesc <
http://www.w3.org/2006/time#inXSDDateTime> ?xsddt.
 FILTER (

        <http://www.w3.org/2001/XMLSchema#dateTime>(?xsddt) <=
        <
http://www.w3.org/2001/XMLSchema#dateTime>("2016-04-29T05:00:00")
&&
        <
http://www.w3.org/2001/XMLSchema#dateTime>(?xsddt) >=
        <
http://www.w3.org/2001/XMLSchema#dateTime>("2016-04-30T08:00")
        )
}

This query is not working. The error code I am receiving is the following one:
Message: Lexical error at line 18, column 85.  Encountered: "\n" (10), after : "\"2016-04-08T00         )"

I have tried this same query in a browser (SPARQL endpoint) and it works.

I realized that the query works as long as I only introduce one dateTime. For example, this query works and returns the expected triples (note that only one dateTime is used):

SELECT * 
FROM <urn:calendarData>
WHERE {
  ?instant  <
http://www.w3.org/2006/time#hasDateTimeDescription> ?dtdesc.
  ...
  ?dtdesc <
http://www.w3.org/2006/time#inXSDDateTime> ?xsddt.
 FILTER (

        <http://www.w3.org/2001/XMLSchema#dateTime>(?xsddt) <=
        <
http://www.w3.org/2001/XMLSchema#dateTime>("2016-04-29T05:00:00")
&&
        <
http://www.w3.org/2001/XMLSchema#dateTime>(?xsddt) >=
        <
http://www.w3.org/2001/XMLSchema#dateTime>("2016-04-30")
        )
}

However, I need to use two dateTimes in the query, in order to get the statements from a certain interval of time.

Is this happening to someone else? Should I use other format to query dateTimes in the RapidMiner LOD Extension?

Thanks in advance,
Iker

 

Iker Esnaola Gonzalez

Informazio-Sistema Adimenduen Unitatea

Sistemas de Información Inteligentes

Intelligent Information Systems Unit

iker.e...@tekniker.es

+34 943 20 67 44  Ext: 9608

LogoTEK_Firma2015.jpg

PARKE TEKNOLOGIKOA

C/ Iñaki Goenaga, 5

20600 Eibar, Gipuzkoa (Spain)

Tel.: +34 943 20 67 44

 

Youtube-.pngTwitter-.pngFlickr-.pngSlideshare-.pngIssuu--.png

LogoParke_Firma2015.png

 

 

 


Mezu honen informazioa isilpekoa izan daiteke eta indarrean dagoen legediak babesten du. Hutsegite baten ondorioz jaso baduzu, bidal iezaiozu berriro bidaltzaileari eta ezaba ezazu. Milesker zure laguntzagatik.
La información de este correo puede ser confidencial y está protegida por la legislación vigente. Si ha recibido este correo por error, reenvíelo a su emisor y elimínelo. Gracias por su ayuda.
This e-mail may contain confidential information that is protected by our laws. If you have received this e-mail by mistake, please, notify the sender and delete it. Thank you for your help.

Petar Ristoski

unread,
Sep 6, 2016, 11:34:38 PM9/6/16
to RapidMiner Linked Open Data Extension, iker.e...@tekniker.es
Hi Iker,

Could you please share the SPARQL endpoint you are using, so I could test the query? Or is it a private SPARQL endpoint?

Cheers,
Petar

Iker Esnaola

unread,
Sep 7, 2016, 2:33:07 AM9/7/16
to Petar Ristoski, RapidMiner Linked Open Data Extension

Hi Petar,

 

Thanks for answering. I am afraid it is a private SPARQL endpoint. I have been trying different things, but I cannot solve this issue.

 

Best regards,

Iker

Petar Ristoski

unread,
Sep 26, 2016, 9:50:24 AM9/26/16
to RapidMiner Linked Open Data Extension, petar.ri...@gmail.com, iker.e...@tekniker.es
Hi Iker,

Did you manage to resolve the issue? 
I think there is a parsing issue in the extension with the time. So if you leave out the minutes and seconds in the dateTime it should work, e.g. replace "2016-04-29T05:00:00" with ""2016-04-29T05".

Cheers,

Petar

Iker Esnaola

unread,
Sep 27, 2016, 9:33:27 AM9/27/16
to Petar Ristoski, RapidMiner Linked Open Data Extension

Hello Petar,

 

Thank you very much for your response. The solution provided works J

 

Best regards,

Iker

 

De: Petar Ristoski [mailto:petar.ri...@gmail.com]
Enviado el: lunes, 26 de septiembre de 2016 15:50
Para: RapidMiner Linked Open Data Extension
CC: petar.ri...@gmail.com; Iker Esnaola
Asunto: Re: SPARQL query issue with xsd:dateTime

 

Hi Iker,

Reply all
Reply to author
Forward
0 new messages