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

Improve template parse error messages #796

Merged
merged 3 commits into from
Jan 13, 2021
Merged

Improve template parse error messages #796

merged 3 commits into from
Jan 13, 2021

Conversation

beckyjackson
Copy link
Contributor

Resolves #795

  • docs/ have been added/updated
  • tests have been added/updated
  • mvn verify says all tests pass
  • mvn site says all JavaDocs correct
  • CHANGELOG.md has been updated

When using a restriction with a non-property entity, you will see:

MANCHESTER PARSE ERROR the expression ('test 1' some 'test 4') at row 7, column 4 in table "test.tsv" cannot be parsed: encountered unexpected 'some'
	hint: the term before 'some' must be a property
For details see: http://robot.obolibrary.org/template#manchester-parse-error

For all other types of parse errors, you will now see some expected suggestions. These come directly from the parser, but I tried to format them as much as possible to make sense.

e.g., using a class in a restriction for a data property:

MANCHESTER PARSE ERROR the expression ('test 1' some 'test 3') at row 5, column 4 in table "test.tsv" cannot be parsed: encountered 'test 3', but expected one of:
	Datatype name
	not
	{ ... }
For details see: http://robot.obolibrary.org/template#manchester-parse-error

Or using an undeclared class:

MANCHESTER PARSE ERROR the expression ('test 1' some 'test 4') at row 5, column 4 in table "test.tsv" cannot be parsed: encountered 'test 4', but expected one of:
 name
	( ... )
	{ ... }
	Self
For details see: http://robot.obolibrary.org/template#manchester-parse-error

@beckyjackson
Copy link
Contributor Author

I'm not really sure why that first test failed, but it's fixed now...

@beckyjackson beckyjackson merged commit 625d967 into master Jan 13, 2021
@beckyjackson beckyjackson deleted the 795-fix branch January 13, 2021 18:36
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

Successfully merging this pull request may close these issues.

Better error messages for "encountered unknown..." template errors
2 participants