Evaluation of JSON-LD for OSLC Usage
Status of this Document: Informational purposes only
Purpose of this page is to determine if the standardization work for defining a JSON format for RDF would be acceptable for OSLC needs. There a number of factors to consider which will be outlined below.
Capability |
Supported? |
Notes |
Namespace |
Supported |
Also has a way to do so by adding namespace prefix definitions that doesn't collide with OSLC's |
Content type |
Supported |
Either application/ld+json or application/json is supported. OSLC uses application/json so no conflict |
Blank nodes |
Supported |
Needed for OSLC Link Labels |
Samples
oslc_cm:ChangeRequest as OSLC JSON
{
"prefixes" : {
"dcterms" : "http://purl.org/dc/terms/",
"oslc" : "http://open-services.net/ns/core#",
"oslc_cm" : "http://open-services.net/ns/cm#",
"ex" : "http://example.com/bugtracker"
},
"rdf:about" : "http://example.com/bugs/2314",
"rdf:type" : [{
"rdf:resource" : "http://open-services.net/ns/cm#ChangeRequest"
}],
"dcterms:identifier" : "00002314",
"oslc:shortTitle" : "Bug 2314",
"dcterms:title" : "Invalid installation instructions",
"oslc:instanceShape" : {
"rdf:resource" : "http://example.com/shapes/defect"
},
"dcterms:description" : "Invalid installation instructions indicating invalid patches to be applied.",
"dcterms:creator" : [{
"rdf:resource" : "http://myserver/mycmapp/users/joe"
}],
"dcterms:contributor" : [{
"rdf:resource" : "http://myserver/mycmapp/users/bob"
}],
"dcterms:modified" : "2008-09-16T08:42:11.265Z",
"dcterms:created" : "2008-07-04T11:00:00.000Z",
"oslc_cm:status" : "InProgress",
"oslc_cm:tracksRequirement" : [{
"rdf:resource" : "http://myserver/reqtool/req/34ef31af",
"dcterms:title" : "Link label for local req"
},
{ "rdf:resource" : "http://remoteserver/reqrepo/project1/req456",
"dcterms:title" : "Req456: Link label for remote requirement"
}],
"ex:priority" : "Medium",
"ex:severity" : "Normal"
}
oslc_cm:ChangeRequest as OSLC JSON + JSON-LD
{
"@context" : {
"dcterms" : "http://purl.org/dc/terms/",
"oslc" : "http://open-services.net/ns/core#",
"oslc_cm" : "http://open-services.net/ns/cm#",
"ex" : "http://example.com/bugtracker"
},
"@id" : "http://example.com/bugs/2314",
"@type" : "http://open-services.net/ns/cm#ChangeRequest",
"prefixes" : {
"dcterms" : "http://purl.org/dc/terms/",
"oslc" : "http://open-services.net/ns/core#",
"oslc_cm" : "http://open-services.net/ns/cm#",
"ex" : "http://example.com/bugtracker"
},
"rdf:about" : "http://example.com/bugs/2314",
"rdf:type" : [{
"rdf:resource" : "http://open-services.net/ns/cm#ChangeRequest"
}],
"dcterms:identifier" : "00002314",
"oslc:shortTitle" : "Bug 2314",
"dcterms:title" : "Invalid installation instructions",
"oslc:instanceShape" : {
"rdf:resource" : "http://example.com/shapes/defect"
},
"dcterms:description" : "Invalid installation instructions indicating invalid patches to be applied.",
"dcterms:creator" : [{
"rdf:resource" : "http://myserver/mycmapp/users/joe"
}],
"dcterms:contributor" : [{
"rdf:resource" : "http://myserver/mycmapp/users/bob"
}],
"dcterms:modified" : "2008-09-16T08:42:11.265Z",
"dcterms:created" : "2008-07-04T11:00:00.000Z",
"oslc_cm:status" : "InProgress",
"oslc_cm:tracksRequirement" : [{
"rdf:resource" : "http://myserver/reqtool/req/34ef31af",
"dcterms:title" : "Link label for local req"
},
{ "rdf:resource" : "http://remoteserver/reqrepo/project1/req456",
"dcterms:title" : "Req456: Link label for remote requirement"
}],
"ex:priority" : "Medium",
"ex:severity" : "Normal"
}
Issues
- What happens when a server returns any variant of JSON-LD it wants: compact, expanded, compact IRI
- Why is
@type
not defined to be same semantics as rdf:type
? see type defn It also appears to overload the definition of value type and resource type using @type, a problem?
- Appears that
@type
object doesn't support multi-values, i.e. doesn't allow for multi-typed resources.
- TODO: determine if how "link labels" will be represented and/or round tripped (likewise for other concepts such as bnodes)
- Still have the problem knowing objects vs. arrays ahead of time to ease consumers?
- Recommend this as 3.0 JSON format and how to migrate (or content negotiation)
Issues have been sent to the
public-rdf-comments@w3.org maillist
References