Nicolae; I would suggest using SPARQL string functions to remove the ":".  You may also find spif:regex() and spif:replaceAll() useful.

For the latter two, see Composer Help > Reference > SPARQL Functions Reference.

-- Scott

On 5/28/2014, 6:15 AM, Nicolae Marasoiu wrote:
Hi,

Just to clarify, I use a sparql _expression_ to bind an argument to PostReqest.

Putting directly sparql _expression_ "string" + now +"string2" does not work.
Putting a formatting explicitly does not give the timezone in the format wanted by xsd, because Java until recently in Java 8 yields +0300 as Z (the timezone part) instead of the +03:00 wanted by xsd.

Please see details in my previous message below/above.

Thanks
Nicu

On Wednesday, May 28, 2014 1:15:19 PM UTC+3, Nicolae Marasoiu wrote:
Hi,

The cause is that the timezone as represented by java "Z" format is +0300 not +03:00.

Can you please advice a way to output an xsd:dateTime compatible string representation of the now()?

I tried this but fails (with unkown error):
spif:dateFormat(now(), "YYYY-MM-dd")) + "T") + spif:dateFormat(now(), "HH:mm:ss")) + spif:substring(spif:dateFormat(now(), "Z"), 1, (spif:string-length(spif:dateFormat(now(), "Z")) - 2)))

how can i see the error? it just shows that the variable being bound does not have any string value assigned to it.

Thanks
Nicu

On Tuesday, May 27, 2014 5:32:32 PM UTC+3, Scott Henninger wrote:
Nicolae;  On creating the Date time, why not just use SPARQL now() directly, i.e.:

BIND(now() AS ?date)
...or
SELECT (now() AS ?date)...

In terms of the error message, the leading and trailing apostrophe is probably to blame.  The syntax of ant RDF literal is a string with the xsd:type appended, e.g. "2014-05-27T14:06:11+0300"^^xsd:dateTime. 

In your case the result seems to be "'2014-05-27T14:06:11+0300'"^^xsd:dateTime - not the extra quote that makes it illegal syntax for xsd:dateTime.

-- Scott

On 5/27/2014, 6:10 AM, Nicolae Marasoiu wrote:
Hi,

I am trying to generate the currend xsd:dateTime to insert in a dynamic XML payload with:
spif:dateFormat(now(), "YYYY-MM-dd")) + "T" + spif:dateFormat(now(), "HH:mm:ssZ")

Sending out content yields XSD validation exception, probably from the remoint endpoint XSD validation:

Reason:
org.topbraid.spin.sparqlmotion.modules.SMException: 
The 'dateSent' element is invalid - The value '2014-05-27T14:06:11+0300' is invalid according to its datatype 'DateTime' - The string '2014-05-27T14:06:11+0300' is not a valid DateTime value.

However, according to http://www.schemacentral.com/sc/xsd/t-xsd_dateTime.html, 2014-05-27T14:06:11+0300 should be a valid xsd dateTime value!

Please advice,
Nicu
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
topbrai...@googlegroups.com
To unsubscribe from this group, send email to
topbraid-user...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
topbraid-users@googlegroups.com
To unsubscribe from this group, send email to
topbraid-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
topbraid-users@googlegroups.com
To unsubscribe from this group, send email to
topbraid-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to