Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other SPARQL Features #4

Open
martinleopold opened this issue Dec 11, 2015 · 2 comments
Open

Other SPARQL Features #4

martinleopold opened this issue Dec 11, 2015 · 2 comments

Comments

@martinleopold
Copy link

Here's some more features from the SQARQL spec that might be implemented:

@martinleopold martinleopold changed the title Other S Other SPARQL Features Dec 11, 2015
@dasantonym
Copy link
Member

optional and union were already in the code. currently they work as follows:

let pattern1 = new GraphPattern(triple1),
    pattern2 = new GraphPattern([triple1, triple2], false, true), // second option sets UNION flag
    group = new GroupGraphPattern([pattern1, pattern2]);

and

let pattern1 = new GraphPattern(triple1),
    pattern2 = new GraphPattern([triple1, triple2], true, false), // first option sets OPTIONAL flag
    group = new GroupGraphPattern([pattern1, pattern2]);

not sure if this is the best way to represent it and i don't like the options in the constructor that much. i might update it to work like this:

let group = new GroupGraphPattern({
    $union: [pattern1, pattern2]
});

but first the subqueries... do you know if multiple subqueries are allowed? i couldn't really tell from the spec or i overlooked something.

@dasantonym
Copy link
Member

subqueries are now also included. you can just add a query as an element to a graph pattern. the endpoint can be null for this subquery (it is ignored so set it to whatever you want). prefixes and base are skipped when converting the subquery to string.

var pattern = new GraphPattern([triple1, triple2, query]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants