Following up on my own email.

On Mon, Sep 14, 2015 at 9:54 PM, Paula Gearon <gea...@gmail.com> wrote:
<snip>

> It's going to be hard to query this endpoint. What if you were to export
> it?
>

I just queried with:

construct { ?s ?p ?o } where { ?s ?p ?o }

It takes a few minutes to run, but you get an RDF/XML document that is
44.7MB in size. You should be able to import this into a local Fuseki and
query it using whichever SPARQL 1.1 features you like.

Paula




> On Mon, Sep 14, 2015 at 9:02 PM, Daniel Leite <danielfariasle...@gmail.com
> > wrote:
>
>> Hello guys,
>>
>> I'm working with LinkedMovieDataBase <http://data.linkedmdb.org/> +
>> Apache
>> Jena and would like to know the sum of the runtime of the films. However I
>> have had many problems with queries using aggregates functions.
>>
>> It is known that literal has its standard type as a string, then it is
>> necessary to cast to decimal. Thus it was formulated the following SPARQL
>> query:
>>
>> PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
>> PREFIX xsd: <http://www.w3.org/2001/XMLSchema>
>> SELECT (SUM(?runtime^^xsd:decimal) as ?sum_runtime)
>> WHERE {?filmUri movie:runtime ?runtime}
>>
>> Returning the following error:
>>
>> Exception in thread "main" com.hp.hpl.jena.query.QueryParseException:
>> Encountered " "^^" "^^ "" at line 1, column 126.
>> Was expecting one of:
>>     "not" ...
>>     "in" ...
>>     <INTEGER_POSITIVE> ...
>>     <DECIMAL_POSITIVE> ...
>>     <DOUBLE_POSITIVE> ...
>>     <INTEGER_NEGATIVE> ...
>>     <DECIMAL_NEGATIVE> ...
>>     <DOUBLE_NEGATIVE> ...
>>     ")" ...
>>     "=" ...
>>     "!=" ...
>>     ">" ...
>>     "<" ...
>>     "<=" ...
>>     ">=" ...
>>     "||" ...
>>     "&&" ...
>>     "+" ...
>>     "-" ...
>>     "*" ...
>>     "/" ...
>>
>> I've done several adaptations to this query and i didn't get the expected
>> result. One approach used was to modify the cast into the following form:
>>
>> ...
>> SELECT (SUM(xsd:decimal(?runtime)) as ?sum_runtime)
>> ...
>>
>> But the return is null, which I do not understand. If you try cast to
>> integer (xsd:integer) or floating point (xsd:float) returns the same
>> error.
>>
>> Using COUNT as aggregation function the result is correct, but the count
>> is
>> not necessary to make the conversion, so it works. With the MIN and MAX
>> functions the result also goes wrong.
>>
>> The proof that the query is semantically correct is that if removing the
>> sum function of the query returns the expected result.
>>
>> Can someone help me?
>>
>> Thanks in advance
>> Daniel Leite
>>
>
>

Reply via email to