Skip to content

parseUpdate refuses valid queries #1758

@eggplants

Description

@eggplants

SPARQLWrapper's way to judge given query's type is to match clauses with regex patterns. So I'm trying to use from rdflib.plugins.sparql.parser import parseQuery, parseUpdate for judging.

But I found few queries in test_wrapper.py was refused by parseUpdate.

  • parseUpdate("WITH <urn:graph> DELETE DATA { <urn:john> <urn:likes> <urn:surfing> }")
    • pyparsing.exceptions.ParseException: Expected end of text, found 'WITH' (at char 0), (line:1, col:1)
  • parseUpdate("PREFIX e: <http://example.org/> INSERT {e:a e:b e:c}")
    • pyparsing.exceptions.ParseException: Expected end of text, found 'INSERT' (at char 32), (line:1, col:33)

I think these queries are valid and some parser syntaxes related to parseUpdate are wrong.

ref: RDFLib/sparqlwrapper#213

Metadata

Metadata

Assignees

No one assigned

    Labels

    SPARQLbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions