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

Reification inside CONSTRUCT is not accepting breakline before partial statements #110

Open
rogerlucena opened this issue Jun 30, 2020 · 0 comments

Comments

@rogerlucena
Copy link
Contributor

When doing reification inside a CONSTRUCT clause with partial statements, as documented here, BQL yields a parsing error if a breakline is used before the partial statements.

To illustrate, the following code for reification with CONSTRUCT works:

CONSTRUCT {
  ?ancestor "grandparent"@[] ?grandchildren ; "both_live_in"@[] /city<NY>
}
INTO ?grandparents
FROM ?family
WHERE {
  ?ancestor "parent_of"@[] ?c .
  ?c "parent_of"@[] ?grandchildren
};

But the following code does not:

CONSTRUCT {
  ?ancestor "grandparent"@[] ?grandchildren ; 
            "both_live_in"@[] /city<NY>
}
INTO ?grandparents
FROM ?family
WHERE {
  ?ancestor "parent_of"@[] ?c .
  ?c "parent_of"@[] ?grandchildren
};

Yielding the following error message:

Processing statement (3/6):
CONSTRUCT { ?ancestor "grandparent"@[] ?grandchildren ;

[FAIL] [ERROR] Failed to parse BQL statement with error Parser.parse: Failed to consume symbol CONSTRUCT_FACTS, with error Parser.parse: Failed to consume symbol CONSTRUCT_TRIPLES, with error Parser.parse: Failed to consume symbol MORE_CONSTRUCT_PREDICATE_OBJECT_PAIRS, with error Parser.parse: Failed to consume symbol CONSTRUCT_PREDICATE, with error Parser.consume: could not consume token (EOF, , ) in production CONSTRUCT_PREDICATE

Processing statement (4/6):
"both_live_in"@[] /city<NY> } INTO ?grandparents FROM ?family WHERE { ?ancestor "parent_of"@[] ?c . ?c "parent_of"@[] ?grandchildren };

[FAIL] [ERROR] Failed to parse BQL statement with error Parser.consume: could not consume token (PREDICATE, "both_live_in"@[], ) in production START

It may be related with this part of the grammar.

You can use the code in the file below to reproduce the aforementioned error.

reification_breakline_error.pdf

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

1 participant