Skip to content

A mix of issues and questions #86

@rat10

Description

@rat10

Thank you for your work on Traqula! It looks very promising, and I'm especially curious to explore the round tripping feature. I'd like to use Traqula in a project where I need to parse many queries on one specific quad store. I tested Traqula with a few hundred queries, and 85% of them pass without issues. The issues I ran into are varied. Some of them are idiosyncracies of the quad store the queries are run against, some might be missing features, one seems to be a small bug. In any case I'd be glad to get your opinion on how to best tackle them. I'm trying to assess how much effort it will take to create a patch that fixes all of them.

  1. Validation errors
    In some cases Traqula is able to parse a query but rejects it for semantic reasons. There seems to exist an option to ignore validation errors and return a JSON object anyway via the skipValidation argument, but I can't get it to work.
try {
  parser.parse(sparql, args.skipValidation ? { skipValidation: true } : undefined);
  ok++;
  if (!args.quiet && ok % 1000 === 0) {
    console.log(`Parsed ${ok} ok...`);
  }
} catch (e) {
  // ...
}

It seems like in @traqula/rules-sparql-1-1/dist/esm/lib/grammar/queryUnit.js, the selectQuery rule calls queryIsGood(ret); unconditionally, without if (!C.skipValidation) guard. Am I doing something wrong?

  1. Variables starting with a digit
    It seems like Traqula doesn't accept variables that start with a digit. IIIUC those are legal according to spec. Am I wrong, and/or is this how you want it to be? In any case a patch should be reasonably easy.

  2. Missing WHERE keyword in nested SELECT statements
    Again it seems like this is legal in SPARQL, but not supported in Traqula. And again it seems quite easy to patch. What's your take?

  3. Jena textMatch
    Some queries use textMatch syntax, an ARQ/Jena text search function / “magic property” that is not part of SPARQL. Do you have ideas on how to support this, or even plans to do so?

  4. Property path repetition
    Some queries use {n} syntax for property path expressions. IIUC this idiom is also used in other RDF stores. Do you have an idea of how it could be supported in Traqula, or even plans to do so?

  5. LATERAL
    Some queries use lateral { select ... }. I guess I'm on my own with that one. [EDIT or maybe not?]

  6. Aggregate shorthand in SELECT
    Some queries use count(*) without defining a variable name, i.e. omitting the AS ?count part. That is non-standard syntactic sugar and I don't assume you have any interest in supporting it. Should be easy to patch locally.

I'd be glad to get your opinions on these issues before I start to work on them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions