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

Check for invalid literals as ouput of parsers #140

Open
pchampin opened this issue Oct 20, 2023 · 2 comments
Open

Check for invalid literals as ouput of parsers #140

pchampin opened this issue Oct 20, 2023 · 2 comments
Assignees
Milestone

Comments

@pchampin
Copy link
Owner

The current Turtle file is valid according to the grammar:

[] <tag:> "foo"@abcde .

However, abcde is not a valid BCP47 language tag, so the produced graph is not valid according to the RDF abstract syntax.

Currently, Sophia blindly trusts the output of the parsers, creating the corresponding language rag with LanguageTag::new_unchecked, which results in a value violating the contract of its type.

The output of parsers should therefore be checked, at least for the language tags.

@pchampin
Copy link
Owner Author

A similar issue, which I raised here, occurs when a literal is explicitly typed as rdf:langString but has no language tag. This also should be checked -- unless Turtle (and other concrete syntaxes) are changed to reject it.

@pchampin pchampin self-assigned this Oct 20, 2023
@pchampin pchampin added the bug Something isn't working label Oct 20, 2023
@pchampin
Copy link
Owner Author

False alarm... abcde is in fact a valid BCP47 tag, my mistake.
On the contrary, abcdefghi is an invalid tag, and is correctly rejected by all Sophia parsers.

"foo"^^rdf:langString may still be an issue, though, pending the decisions of the RDF 1.2 WG.

@pchampin pchampin removed the bug Something isn't working label Oct 20, 2023
@pchampin pchampin added this to the later milestone Dec 14, 2023
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