On 12/05/14 13:57, Alejandro Rodríguez González wrote:
Hi!
Thanks for your answer both! Yep, the problem was in the parenthesis. Sorry
if the message arrive twice to the mailing list, I had some problems with
the email!
There were problems - all Apache lists email was offline for much of
last week. The email system lost an entire disk array to multiple,
simultaneous disk failures and it required signifcant work to recover
from the catastrophic failure.
The backlog was 9 million messages.
Andy
https://blogs.apache.org/infra/entry/mail_outage
Cheers
On 11 May 2014 18:27, Andy Seaborne <[email protected]> wrote:
On 9 May 2014 11:38, Alejandro Rodríguez González
<[email protected]> wrote:
Hi all,
Maybe this question has been already answered or is in the documentation,
but I can't find an answer.
I have a code to perform a set of SPARQL queries against a concrete
dataset. My problem is that, the SPARQL query is making use of datatype()
function, and it seems that Jena is not recognizing this function (and
therefore return me an error).
The query that I want to perform is the following:
*SELECT distinct datatype(?o) as ?datatype*
The syntax is:
SELECT distinct (datatype(?o) as ?datatype)
The () are not to do with DISTINCT, they come from the AS part:
(expression AS ?variable)
*FROM <@NAMED_GRAPH>*
*WHERE {*
* ?s a <@SUBJECT_TYPE> .*
*?s <@PREDICATE_TYPE> ?o . *
* FILTER isLiteral(?o)*
*}*
*group by ?o*
Originally it was "SELECT distinct(datatype(?o)) as ?datatype" but I saw
that distinct should be used without parenthesis. (I also try with
"SELECT
distinct datatype ?o as..." with no positive result).
An example of the query:
SELECT distinct datatype(?o) as ?datatype
FROM <http://bio2rdf.org/bio2rdf.dataset:bio2rdf-affymetrix-20131220>
WHERE {
?s a <http://bio2rdf.org/affymetrix_vocabulary:Genechip-Array> .
?s <http://bio2rdf.org/affymetrix_vocabulary:x-unigene> ?o .
FILTER isLiteral(?o)
}
group by ?o
If I perform the query against the endpoint (
http://s4.semanticscience.org:14001/sparql), it runs fine (in this case
is
not returning any result, but no errors are thrown):
http://s4.semanticscience.org:14001/sparql?default-graph-uri=&query=SELECT+distinct+datatype%28%3Fo%29+as+%3Fdatatype%0D%0AFROM+%3Chttp%3A%2F%2Fbio2rdf.org%2Fbio2rdf.dataset%3Abio2rdf-affymetrix-20131220%3E%0D%0AWHERE+%7B%0D%0A+%3Fs+a+%3Chttp%3A%2F%2Fbio2rdf.org%2Faffymetrix_vocabulary%3AGenechip-Array%3E+.%0D%0A%3Fs+%3Chttp%3A%2F%2Fbio2rdf.org%2Faffymetrix_vocabulary%3Ax-unigene%3E+%3Fo+.+++%0D%0A+FILTER+isLiteral%28%3Fo%29%0D%0A%7D%0D%0Agroup+by+%3Fo&format=text%2Fhtml&timeout=0&debug=on
However, when I use my code (which generates the query ok, I check it
printing the query), it returns the following exception:
http://pastebin.com/qhzyxJKn
The code which performs the query is here (the method which throws the
exception is the QueryFactory.create(..): http://pastebin.com/2VVgKyZT
I guess that it is a problem "calling" datatype function, but not sure
how
to solve it.
Thanks!
--
Dr. Alejandro Rodríguez González - PhD
Bioinformatics at Centre for Plant Biotechnology and Genomics UPM-INIA
Polytechnic University of Madrid
http://www.alejandrorg.com
Phone: +34 914524900 . Ext: 25550
*Once the game is over, the king and the pawn go back in the same box. -
Italian proverb*
On 11 May 2014 18:20, james anderson <[email protected]> wrote:
good evening dr rodriguez;
On 11 May 2014, at 01:12, Alejandro Rodríguez González <
[email protected]> wrote:
SELECT distinct datatype(?o) as ?datatype
FROM <http://bio2rdf.org/bio2rdf.dataset:bio2rdf-affymetrix-20131220>
WHERE {
?s a <http://bio2rdf.org/affymetrix_vocabulary:Genechip-Array> .
?s <http://bio2rdf.org/affymetrix_vocabulary:x-unigene> ?o .
FILTER isLiteral(?o)
}
group by ?o
note that, where you have indicated the “group by ?o”, you have specified
an aggregation.
of this aggregation, strictly speaking, the ?o in the projection clause
should be used with the“sample” operator before it can be supplied to
‘datatype’.
although, perhaps jena makes an exception here...
best regards, from berlin,
---
james anderson | [email protected] | http://dydra.com