-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Support @view as built-in JSON-LD syntax in solid-shim, expanding to the jsonld:view predicate.
Live Implementation
🚀 See it working: https://jsonos.com/examples/
Background
@view should work like @type - zero context required:
{
"@context": {"schema": "http://schema.org/"},
"@type": "schema:Person",
"@view": "https://example.com/panes/person.js",
"schema:name": "Alice"
}Just like @type expands to rdf:type, @view should expand to jsonld:view.
Implementation
When parsing JSON-LD, solid-shim should:
- Recognize
@viewas a reserved keyword - Expand it to
http://www.w3.org/ns/json-ld#view - Store the triple:
<subject> jsonld:view <viewUrl>
// In parseJsonLdToStore or similar
if (data['@view']) {
const VIEW = $rdf.Namespace('http://www.w3.org/ns/json-ld#')
store.add(subject, VIEW('view'), $rdf.sym(data['@view']))
}Semantic Equivalence
For interop with Solid's ui vocabulary:
jsonld:view owl:equivalentProperty ui:view .This means queries for either predicate should match.
Why jsonld:view?
- JSON-LD native namespace
- W3C controlled
- Clear path to standardization
- Bridges to
ui:viewvia equivalentProperty
Related
- Proposal: @view as syntactic sugar for a standard RDF predicate json-os/json-os.github.io#1 - The
@viewproposal - Current mashlib.min.js already handles
@viewfor pane dispatch
Metadata
Metadata
Assignees
Labels
No labels