Clarification needed for expansion of terms with `@container` set to `@id` and a local context with a `@base`
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 139
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
When expanding this compact data:
{
"@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns/",
"@vocab": "https://example.org/ns#",
"typeDescribed": {
"@id": "rdf:type",
"@context": {"@base": "https://example.org/ns/"},
"@container": "@id"
}
},
"@id": "/item/1",
"typeDescribed": {
"Item": {"label": "Item"}
}
}
I cannot tell from the spec (step 13.8.3.7.4 of the expansion algorithm) whether the key Item will be resolved against the local context or not. Actually, reading the spec I see nothing that sets the active context to the local context of the typeDescribed before reaching 13.8.3.7.4, although I would expect that this is the intention. Both the JSON-LD Playground and the Ruby RDF Distiller do expand the above to this:
[
{
"@id": "/test/item/1",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
{
"https://example.org/ns/label": [
{"@value": "Item"}
],
"@id": "https://example.org/ns/Item"
}
]
}
]
In the Ruby code corresponding to step 13.8.2 and onwards, IIRC, a container_context is defined and from thereon used.
Unless I've missed something in the algorithm that clarifies that something like this is required, I believe we should clarify this exhaustively in the spec, and add this test case (unless I've overlooked an existing one for this).
I've made a similar adjustment to TRLD to reflect this presumably desired behaviour.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read step 13.8.3.7.4 of the JSON-LD expansion algorithm and compare it with lib/json/ld/expand.rb around line 615. Check the linked Ruby RDF Distiller and TRLD behavior, then clarify the specification and add a regression test for the @container: @id case with a local @base context.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100