This repository was archived by the owner on Jan 8, 2025. It is now read-only.
feat: support rdf:LangString datatype (+test) - #139
Open
Yucukof wants to merge 2 commits into
Open
Conversation
This was referenced Jun 10, 2022
geistinme
suggested changes
Jun 16, 2022
Prefix update
Author
|
Sorry, this took me way more time than it should have... |
geistinme
approved these changes
Jun 28, 2022
Owner
There was a problem hiding this comment.
@Yucukof
I also thought about it a bit more and I am still questioning whether this is the right code to be generated. This also goes into #140 and eventually we'll need to implement the creation params in shex-methods.
Instead of:
} else if (valueExpr?.datatype === ns.rdf('langString')) {
return toCreate ? 'string | Literal' : 'string';
...We should force developers to supply the language with the string when they create shapes and similarly we should return the full literal node that includes the language when reading shapes; so more fitting would be:
} else if (valueExpr?.datatype === ns.rdf('langString')) {
return 'Literal';Sorry that I am only bringing this up now, but I didn't have much time to maintain this lib atm. I will make these changes to this PR and #140. Thank you for pointing this out 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of current, datatype
rdf:langStringis not supported.If we try to convert the following shex
Then the code generation fails because it applies the type as a raw string.
The following code change fixes the issue without breaking the test.