RubenVerborgh / SPARQL.js

A parser for the SPARQL query language in JavaScript
Other
342 stars 66 forks source link

Feature/path only parsing #155

Closed jeswr closed 2 years ago

jeswr commented 2 years ago

This PR adds the feature to parse only SPARQL paths rather than the full SPARQL algebra.

This is of use in several downstream applications including here in LDflex

RubenVerborgh commented 2 years ago

I like the idea, but do we have other usage besides LDflex? I.e., it seems that LDflex could just slap a SELECT * around it?

jeswr commented 2 years ago

it seems that LDflex could just slap a SELECT * around it?

Correct that's the current behavior

other usage

Not that I have top of mind, but I wouldn't be surprised if I need the same behavior in other libs down the line. Happy to park it until that occurs.

RubenVerborgh commented 2 years ago

Happy to park it until that occurs.

We can do it; let's just check the final bundle size. Jison can be weird like that.

jeswr commented 2 years ago

final bundle size

The generated SparqlParser.js increases by ~0.5% (112K before and after if you round).

RubenVerborgh commented 2 years ago

Perfect, that's okay with me.

Are you happy with coverage etc.? Maybe just rename paths/al folder into queries/paths, and similar for test.

jeswr commented 2 years ago

Maybe just rename paths/al folder into queries/paths, and similar for test.

Done

Are you happy with coverage etc.?

I am now after adding those tests for erroring :)

jeswr commented 2 years ago

/bump @RubenVerborgh - this should be ready to merge