Skip to content

SPARQL parser not robust to spurious semicolon #381

Closed
@pchampin

Description

@pchampin

The following code:

import rdflib; res = rdflib.Graph().query("""
PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
CONSTRUCT {
  [ a rdfs:Class; ] .
} WHERE {}
""")

fails with:

Exception: these aint triples

while that SPARQL query is accepted by the validator at http://sparql.org/query-validator.html . If you remove the ";" after rdfs:Class, it works.

Granted, that semicolon is not required, but it should be tolerated (the Turtle parser tolerates it).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions