-
Notifications
You must be signed in to change notification settings - Fork 35
Is the possibility of having @id: null
in an expanded document intended?
#480
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
Comments
@id: null
in a expanded document intended?@id: null
in an expanded document intended?
This could be addressed by merging steps 13.4.3.1 and 13.4.3.2 in the Expansion algorithm, to check that the result of IRI expanding the value is a string, which it shouldn't be because the In this case, it's either an error, or no |
This odd case happens in the expansion test 122. The output of this test is not a valid JSON-LD document. |
This issue was discussed in a meeting.
View the transcriptRob Sanderson: #480Gregg Kellogg: This is an implication of ignoring keyword-like things. … The intention is that if you see something that looks like a keyword to be ignired, it would not result in any properties that would be added to the expansion output. … In this case, this reveals that there may be other cases requiring a more substantial change. So we may have to work with this, and tackle it in the future. … It would only be a problem for docs using invalid keywords that are ignored in any case. Those cases may result in invalid documents. There is nothing inherrently wrong with this, but we may need a proper solution in the future. … @JSON is only valid for @type values, so if someone would use it as a value for a node, there is no logic that would transform it into rdf:json. Since it is a valid keyword, it could result in a URI if you have an @vocab. … In CBOR, that is not a keyword, the result would be null. Same thing if @type is used in a node object. Neither of those cases would produce anything invalid. It’s a special case. The problem may be entirely contained to @id. Rob Sanderson: We should defer to future version. This is a an edge case that would result in more weirdness through the algorithm. Proposed resolution: Defer api #480 until future version, as error case of assigning a non-URI as a URI leads to a further (worse) error case, and the solution would be far reaching (Rob Sanderson) Gregg Kellogg: We could annotate the test related to this that this results in invalid jsonld. Gregg Kellogg: +1 Ruben Taelman: +1 Rob Sanderson: +1 Ivan Herman: + Pierre-Antoine Champin: +1 Benjamin Young: +1 Resolution #6: Defer api #480 until future version, as error case of assigning a non-URI as a URI leads to a further (worse) error case, and the solution would be far reaching |
In my implementation I ignore ids expanded to [
{
"http://example.org/vocab/foo.bar": [
{
"@id": "http://example.org/@foo.bar"
}
],
"http://example.org/vocab/ignoreme": [
{}
],
"http://example.org/vocab/at": [
{
"@id": "http://example.org/@"
}
]
}
] It seems to me to be the right solution, although I'm a bit worried about
I'm not sure to understand why, and if it applies to my solution. So for now I'm stuck with this only failing test, and I'm not comfortable allowing invalid documents to be represented by my datatype model. |
…esult. Note: toRdf/e122 does not include a triple for this, so it remains normative. For #480.
@timothee-haudebourg This is addressed in #481 by marking expand/0122 non-normative. The issue remains deferred for the future. |
…esult. Note: toRdf/e122 does not include a triple for this, so it remains normative. For #480.
This issue also impacts the deserialization test suite. Test #e122 uses the above JSON-LD document as input. I believe the test can only pass using the "invalid" output of the expansion algorithm.
If I can give my opinion, |
I agree that the expansion algorithm shouldn't generate My own implementation, which doesn't follow the spec, also generates a different output:
This is likely because the |
I went full circle today trying to understand why my implementation could not pass the toRdf test #te122, just to find my own previous comment explaining to my present self why. Since expand/0122 is marked as non normative, shouldn't toRdf/e122 also be marked as non normative as well? |
In the playground implementation, using a keyword-like value as
@id
causes the node id to explicitly expand tonull
. I see why it happens since it is the result of the IRI expansion. However this causes the expanded document to be an invalid JSON-LD document, since puttingnull
for@id
is forbidden.Here is an example where the expanded output is an invalid input.
The text was updated successfully, but these errors were encountered: