architolk / Linked-Data-Theatre

The Linked Data Theatre is a platform for an optimal presentation of Linked Data
GNU General Public License v3.0
38 stars 21 forks source link

Invalid SPARQL query in examples/tutorial #44

Closed skodapetr closed 7 years ago

skodapetr commented 7 years ago

In the example file https://github.com/architolk/Linked-Data-Theatre/blob/master/examples/tutorial/dbpediaresource.ttl

there is a query for DBPedia:

CONSTRUCT {
    <@SUBJECT@> ?p ?o.
    ?o rdfs:label ?olabel
}
WHERE {
    <@SUBJECT@> ?p ?o
    FILTER (isIri(?o) or lang(?o)="" or lang(?o)="@LANGUAGE@")
    OPTIONAL {
        ?o rdfs:label ?olabel.
        FILTER (lang(?olabel) or lang(?olabel)="@LANGUAGE@")
    }
}

when I import this example (with this query) into the RDF storage (GraphDB) and access http://localhost:8080/resource?subject=http://nl.dbpedia.org/resource/Amersfoort I got

(resource-error)MALFORMED QUERY: Lexical error at line 8, column 24. Encountered: " " (32), after : "or"

when I executed this query (with proper substitution for <@SUBJECT@> on Virtuoso endpoint I got the expected result. However when I try to execute it in GraphDB I got :

MALFORMED QUERY: Lexical error at line 9, column 25.  Encountered: " " (32), after : "or"

a solution is to replace the or with || .

The query with or is considered invalid not only by GraphDB but also by Fuseki, the specification is also mentioning logical-or as ||

Used version of Linked Data Theatre : 1.16.0

architolk commented 7 years ago

Thanks for the comment! I've updated the Tutorial.