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
Guidance on application/ld+json
#1040
Comments
I suggest we say that developers can do the following: <script type="application/vc+ld+jwt">
eyJhbGciOiJFUzI1NiIsImlzcyI6ImRpZDpleGFtcGxlOjEyMyIsImtpZCI6IiMwIiwidHlwIjoidmMrbGQrand0IiwiY3R5IjoidmMrbGQranNvbiJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3czaWQub3JnL3ZjL3N0YXR1cy1saXN0LzIwMjEvdjEiXSwiaWQiOiJodHRwczovL3ZlbmRvci5leGFtcGxlL2NyZWRlbnRpYWxzL3N0YXR1cy8zIiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCIsIlN0YXR1c0xpc3QyMDIxQ3JlZGVudGlhbCJdLCJpc3N1ZXIiOiJkaWQ6ZXhhbXBsZToxMjMiLCJ2YWxpZEZyb20iOiIyMDIxLTA0LTA1VDE0OjI3OjQwLjAwMFoiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6Imh0dHBzOi8vdmVuZG9yLmV4YW1wbGUvY3JlZGVudGlhbHMvc3RhdHVzLzMjbGlzdCIsInR5cGUiOiJTdGF0dXNMaXN0MjAyMSIsInN0YXR1c1B1cnBvc2UiOiJzdXNwZW5zaW9uIiwiZW5jb2RlZExpc3QiOiJINHNJQUFBQUFBQUFBMk1BQUkzdkF0SUJBQUFBIn19.eRnHulruzCNFAD4n3PlAkn7hPouynDvMZxmID8bP0hXCZN3_CswKyIOFSyndpD6EhJfET7j5vVEuVrZXnnC_2A
</script>
<script type="application/vc+ld+json">
{JSON.stringify(
{
'@context': [
'https://www.w3.org/ns/credentials/v2',
'https://w3id.org/vc/status-list/2021/v1',
],
id: 'https://vendor.example/credentials/status/3',
type: ['VerifiableCredential', 'StatusList2021Credential'],
issuer: 'did:example:123',
validFrom: '2021-04-05T14:27:40.000Z',
credentialSubject: {
id: 'https://vendor.example/credentials/status/3#list',
type: 'StatusList2021',
statusPurpose: 'suspension',
encodedList: 'H4sIAAAAAAAAA2MAAI3vAtIBAAAA',
},
},
null,
2,
)}
</script>
<!-- VCs can use existing media types for JSON-LD -->
<script type="application/ld+json">
{JSON.stringify(
{
'@context': [
'https://www.w3.org/ns/credentials/v2',
'https://w3id.org/vc/status-list/2021/v1',
],
id: 'https://vendor.example/credentials/status/3',
type: ['VerifiableCredential', 'StatusList2021Credential'],
issuer: 'did:example:123',
validFrom: '2021-04-05T14:27:40.000Z',
credentialSubject: {
id: 'https://vendor.example/credentials/status/3#list',
type: 'StatusList2021',
statusPurpose: 'suspension',
encodedList: 'H4sIAAAAAAAAA2MAAI3vAtIBAAAA',
},
},
null,
2,
)}
</script>
<!-- Example from https://schema.org/EducationalOccupationalCredential -->
<script type="application/ld+json">
{JSON.stringify(
{
'@context': 'https://schema.org',
'@type': ['EducationalOccupationalCredential'],
name: 'Certified Safety Professional',
url: 'https://www.bcsp.org/CSP',
description: `Certified Safety Professionals (CSP) are persons who
perform at least 50% of professional level safety duties,
including making worksite assessments to determine risks,
assessing potential hazards and controls,
evaluating risks and hazard control measures,
investigating incidents,
maintaining and evaluating incident and loss records,
and preparing emergency response plans.`,
credentialCategory: {
'@type': 'DefinedTerm',
'@id': 'http://purl.org/ctdl/terms/Certification',
name: 'Certification',
inDefinedTermSet: {
'@type': 'DefinedTermSet',
'@id': 'http://purl.org/ctdl/terms/',
name: 'Credential Transparency Description Language',
},
},
},
null,
2,
)}
</script> |
I am not clever enough to understand what you are saying with the above code block and would appreciate if you could dumb it down for me. |
I'd like to share an observation regarding the media type used here:
Wouldn't it have been more intuitive and developer-friendly, easier to search, match regex, had standards developed in this way:
Or even:
The use of "application/vc+ld+json" seems unconventional, even to someone experienced in standards. In general, developers tend to be more at ease with "application/ld+json." I recommend using that format if feasible. This is merely an observation. Who knows, maybe the json/ld MIME type will gain traction in the future. |
@melvincarvalho I suggest you send your comments regarding structured suffixes to IETF, before it is too late :) IANA is not going to let us register any of these, unless IETF explains how to process them, and that is not going super well atm... which makes taking a dependency on multiple |
@brentzundel these script tags are processed by search engines as they crawl web pages... those engines are very unlikely to do anything with stuff that is not See: |
It is already too late. IANA long ago set media types to specialize inside-out. Top level is The hard lift for us right now is the last — the fourth — of the above, as we are the first to push hard on having two |
Related open PR: w3c/json-ld-syntax#415 |
The issue was discussed in a meeting on 2023-06-28
View the transcript2.6. Guidance on
|
PR #1189 has been raised to address this issue. This issue will be closed once that PR has been merged. |
PR #1189 has been merged, closing. |
We should beware of the existing behavior for
ld+json
and comment on if this media type is acceptable forcredential+ld+json
andverifiable-credential+ld+json
We had a similar challenge with
did+json
,did+ld+json
and the default behavior fordid.json
in DID Web.We should anticipate developers lagging behind adopting support for new media types.
The text was updated successfully, but these errors were encountered: