I'm trying to find out what XQuery/XPath functions are supported on a given platform. That is - I'd like to be able to test the capabiities of the platform using a query, if that's possible. I'm currently using OWLIM+Sesame+dotNetRdf and tried to use
The XQuery spec states, in relation to functions with a
But every one of the functions that I want to use for date calculations has an
asked 24 Jul '12, 06:53
Andrew Matthews ♦♦
So firstly lets deal with the XPath/XQuery spec part:
As the quote you provided states the
So in XPath/XQuery it would be legitimate to write (today - "P28D") to do that subtract operation.
Now the problem you have is that SPARQL defines what operator mappings must be supported in Section 11.3 (SPARQL 1.0) and Section 17.3 (SPARQL 1.1) - note the tables are identical between the specs the section numbers changed due to new features and document reorganization in the 1.1 spec.
In the XPath arithmetic section you will see that implementations are only required to support
However the SPARQL specification does allow for implementations to add support for additional operand mappings, for example the latest ARQ versions support
Therefore you can only do what you want if the implementation supports the appropriate extension. I'd talk to the Sesame and OWLIM developers to see whether this is supported (or just try it and see what happens). From dotNetRDF's point of view the query will look perfectly valid written this way so I don't think dotNetRDF gets in your way here but let me know if it does.
answered 24 Jul '12, 12:08
Rob Vesse ♦
As a more general and slightly-off-topic but somehow somewhat related answer to the general thrust of the question ...
SPARQL 1.1 Service Descriptions will (hopefully) standardise some standard vocabulary for SPARQL endpoints to advertise their wares, including supported features like functions and extended functions.
This is more of a "watch this space" answer, since I don't know if (m)any endpoints are currently making such descriptions available yet.
answered 24 Jul '12, 22:04
Andrew, why not do today.subtractDays(28) in your host language, then interpolate it in the query?
answered 10 Aug '12, 09:00