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

More robust handling of prefixes #546

Open
aannleax opened this issue Oct 29, 2024 · 0 comments
Open

More robust handling of prefixes #546

aannleax opened this issue Oct 29, 2024 · 0 comments
Labels
Parser Rule-Parser-Related Issue
Milestone

Comments

@aannleax
Copy link
Member

aannleax commented Oct 29, 2024

Currently prefixes can be used as follows:

@prefix prefix: <https://www.example.com> .

fact(prefix:constant).

This syntax may create ambiguity in certain cases. For example, when allowing '-' within prefixes, it may create confusion with the infix operator for subtraction. I.e. in the program

@prefix my-prefix: <https://www.example.com> .

result(my-prefix:constant) : body(?x) .

my-prefix:constant can be interpreted as the constant https://www.example.com/constant or as the subtraction of the constants my and prefix:constant. Currently, - is disallowed from prefix names for that reason.

Another problem occurs when considering a more natural map syntax that separates keys from values through :. Such cases can create confusion, e.g. consider map { a:b:c } which can either be the mapping of a to b:c or a:b to c.

A possible solution to this would be to include the currently known prefixes in the parser state so that it can be matched before other syntactic constructs are evaluated.

@aannleax aannleax added the Parser Rule-Parser-Related Issue label Oct 29, 2024
@aannleax aannleax added this to the Release 0.7.0 milestone Oct 29, 2024
@aannleax aannleax added this to nemo Oct 29, 2024
@github-project-automation github-project-automation bot moved this to Todo in nemo Oct 29, 2024
@aannleax aannleax modified the milestones: Release 0.7.0, Release 0.8.0 Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parser Rule-Parser-Related Issue
Projects
Status: Todo
Development

No branches or pull requests

1 participant