-
Notifications
You must be signed in to change notification settings - Fork 159
compactToRelative option and updates to compact IRI creation #511
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e2d9cdd
Added `compactToRelative` option and tests. Fixed test vocabulary to …
gkellogg 0d071fd
Add mention of IRI compaction changes to changes section.
gkellogg 3d347e1
Clean up issue markers.
gkellogg 59f0f31
Change algorithm for creating compact IRIs to favor terms ending with…
gkellogg 19f2558
Address @dlongley's [comment](https://github.com/json-ld/json-ld.org/…
gkellogg cb04ac6
Update language on terms vs their term definitions to address @dlonle…
gkellogg e4accad
Use `nest value` in term definition, rather than `@nest member`, to d…
gkellogg 6c02c32
Update logic on using prefixes:
gkellogg 526ab56
Slight improvement on creating and checking terms that can be used as…
gkellogg e6b5676
Add @prefix use in grammar.
gkellogg f87ef0e
Couple of more tests on prefixes.
gkellogg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@context": { | ||
"ex": {"@id": "http://example.org/"} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@id": "http://example.org/id1", | ||
"@type": ["http://example.org/Type1", "http://example.org/Type2"], | ||
"http://example.org/term": {"@id": "http://example.org/id2"} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@context": { | ||
"ex": {"@id": "http://example.org/"} | ||
}, | ||
"@id": "ex:id1", | ||
"@type": ["ex:Type1", "ex:Type2"], | ||
"ex:term": {"@id": "ex:id2"} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@context": { | ||
"ex": {"@id": "http://example.org/"} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@id": "http://example.org/id1", | ||
"@type": ["http://example.org/Type1", "http://example.org/Type2"], | ||
"http://example.org/term": {"@id": "http://example.org/id2"} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@context": { | ||
"ex": {"@id": "http://example.org/"} | ||
}, | ||
"@id": "http://example.org/id1", | ||
"@type": ["http://example.org/Type1", "http://example.org/Type2"], | ||
"http://example.org/term": {"@id": "http://example.org/id2"} | ||
} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"@context": { | ||
"compact-iris:": "http://example.com/compact-iris-", | ||
"property": "http://example.com/property" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"http://example.com/property": { | ||
"@id": "http://example.com/compact-iris-are-considered", | ||
"http://example.com/property": "Prefix terms must end in a gen-delim" | ||
} | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't
ex
be used as a prefix definition here and thus be used in the compaction? Its value ends with a "/". I would expect a (negative) test for this to leave terms as-is (as IRIs) when a simple term does not end with a gen-delim or the key with a ":". Or am I missing something?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the text above is written I believe you are correct. But I've actually argued below that we shouldn't do this. I think we should specify one way to create prefixes (append a colon (
:
) to your term). I now see that you argued for this over on #469.I also see @gkellogg's counter argument:
#469 (comment)
However, don't these contexts need to change to call for JSON-LD 1.1 processing rules to be applied anyway? If so, why not make the simpler change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@niklasl
ex
is not used, because it's not a simple term, this test is there to be sure that a term with an expanded term definition is not used for creating a compact IRI. Certainly, when expanding, it would be used, but most expanded term definitions are defined for property values, not things intended as prefixes, this the problem with defining a term "resource", and finding that when compacting, you get "resource:s", which the limitation is attempting to address.I originally did use 1.1 processing rules for this, and we could certainly put that back in, but my worry was that 1.0 processors will continue to do things differently, and this would be confusing in any case. Also,
ex:
can certainly be used in 1.0 to createex::term
, which is allowed, but odd. This just fixes that behavior.The theory is that compact IRI generation in 1.0 is basically broken, so we should attempt to fix it without invoking the heavy-handed step of needing to explicitly define this as a 1.1 processing mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gkellogg, ok, as an attempt to fix 1.0 I agree. Perhaps with 1.1 we can make it such that a colon must be present to define a prefix and only use the trailing gen-delim behavior in 1.0 for compatibility purposes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dlongley see comment below. Seems like a radical departure and totally breaks otherwise fine 1.0 contexts used for creating compact IRIs which may be more confusing, but if only done in a string 1.1 mode, that may be satisfactory. Let's hear some other opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gkellogg I see. I wonder if using "simple" as the arbiter here (as in key + string value) is too brittle. I'll move my thinking into the main thread...