diff --git a/common.js b/common.js index 211fd0331..68f7297db 100644 --- a/common.js +++ b/common.js @@ -36,14 +36,14 @@ var vcwg = { status: "CG-DRAFT", publisher: "Credentials Community Group" }, - "string-meta": { - title: "Requirements for Language and Direction Metadata in Data Formats", - href: "https://w3c.github.io/string-meta/", + "STRING-META": { + title: "Strings on the Web: Language and Direction Metadata", + href: "https://www.w3.org/TR/string-meta/", authors: [ - "Addison Phillips", + "Addison Phillips", "Richard Ishida" ], - status: "Editors-DRAFT", + status: "WD", publisher: "Internationalization Working Group" }, "LD-PROOFS": { diff --git a/index.html b/index.html index c8e74f3d9..e051d84df 100644 --- a/index.html +++ b/index.html @@ -916,7 +916,16 @@

Concrete Lifecycle Example

// identifier for the only subject of the credential "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", // assertion about the only subject of the credential - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "lang": "en" + }, { + "value": "Exemple d'Université", + "lang": "fr" + }] + } }, // digital proof that makes the credential tamper-evident // see the NOTE at end of this section for more detail @@ -965,7 +974,16 @@

Concrete Lifecycle Example

"issuanceDate": "2010-01-01T19:73:24Z", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "lang": "en" + }, { + "value": "Exemple d'Université", + "lang": "fr" + }] + } }, "proof": { "type": "RsaSignature2018", @@ -1084,7 +1102,16 @@

Contexts

"type": ["VerifiableCredential", "AlumniCredential"], "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "lang": "en" + }, { + "value": "Exemple d'Université", + "lang": "fr" + }] + } }, "proof": { ... } } @@ -1180,7 +1207,7 @@

Identifiers

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1253,7 +1280,7 @@

Types

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1458,7 +1485,7 @@

Credential Subject

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1502,7 +1529,7 @@

Issuer

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1551,7 +1578,7 @@

Issuance Date

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1611,7 +1638,7 @@

Proofs (Signatures)

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { @@ -1676,7 +1703,7 @@

Expiration

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -1735,7 +1762,7 @@

Status

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "credentialStatus": { @@ -2360,7 +2387,7 @@

Data Schemas

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "credentialSchema": { @@ -2404,7 +2431,7 @@

Data Schemas

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "credentialSchema": { @@ -2496,7 +2523,7 @@

Refreshing

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "refreshService": { @@ -2579,7 +2606,7 @@

Terms of Use

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "termsOfUse": [{ @@ -2620,7 +2647,7 @@

Terms of Use

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -2714,7 +2741,7 @@

Evidence

"id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "evidence": [{ @@ -2852,7 +2879,7 @@

Zero-Knowledge Proofs

"familyName": "Doe", "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>", + "name": "Bachelor of Science and Arts", "college": "College of Engineering" } }, @@ -3035,8 +3062,8 @@

Disputes

"id": "http://example.com/credentials/245", "currentStatus": "Disputed", "statusReason": { - "@value": "Address is out of date", - "@language": "en" + "value": "Address is out of date.", + "lang": "en" }, }
, "issuer": "https://example.com/people#me", @@ -3518,7 +3545,7 @@
JWT Decoding
"credentialSubject": { "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } } } @@ -4017,7 +4044,7 @@

Bearer Credentials

// note that the 'id' property is not specified for bearer credentials "degree": { "type": "BachelorDegree", - "name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" + "name": "Bachelor of Science and Arts" } }, "proof": { ... } @@ -4472,7 +4499,16 @@

Content Integrity Protection

"credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "image": "https://example.edu/images/58473", - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "lang": "en" + }, { + "value": "Exemple d'Université", + "lang": "fr" + }] + } }, "proof": { ... } } @@ -4499,7 +4535,16 @@

Content Integrity Protection

"credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "image": "ipfs:/ipfs/QmXfrS3pHerg44zzK6QKQj6JDk8H6cMtQS7pdXbohwNQfK/image", - "alumniOf": "<span lang='en'>Example University</span>" + "alumniOf": { + "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", + "name": [{ + "value": "Example University", + "lang": "en" + }, { + "value": "Exemple d'Université", + "lang": "fr" + }] + } }, "proof": { ... } } @@ -4627,11 +4672,11 @@

Accessibility Considerations

There are a number of accessibility considerations implementers should be -aware of when processing data described in this specification. As with any web -standards or protocols implementation, ignoring accessibility issues makes -this information unusable to a large subset of the population. It is important -to follow accessibility guidelines and standards, such as [[WCAG21]], to ensure -all people, regardless of ability, can make use of this data. This is +aware of when processing data described in this specification. As with +implementation of any web standard or protocol, ignoring accessibility issues +makes this information unusable to a large subset of the population. It is +important to follow accessibility guidelines and standards, such as [[WCAG21]], +to ensure all people, regardless of ability, can make use of this data. This is especially important when establishing systems utilizing cryptography, which have historically created problems for assistive technologies.

@@ -4669,105 +4714,135 @@

Data First Approaches

Internationalization Considerations

-There are a number of internationalization considerations implementers should be -aware of when publishing data described in this specification. As with any web -standards or protocols implementation, ignoring internationalization makes it -difficult for data to be produced and consumed across a disparate set of -languages and societies, which would limit the applicability of the -specification and significantly diminish its value as a standard. +There are a number of internationalization considerations implementers +are advised to be aware of when publishing data described in this specification. +As with any web standards or protocols implementation, ignoring +internationalization makes it difficult for data to be produced and consumed +across a disparate set of languages and societies, which would limit the +applicability of the specification and significantly diminish its value as +a standard. +

+ +

+Implementers are strongly advised to read the +Strings on the Web: Language and Direction Metadata document +[[STRING-META]] published by the W3C Internationalization Activity as it +elaborates upon the need to provide reliable metadata about text in order to +support internationalization. Implementers are also urged to read the +Implementation Guidance [[VC-IMP-GUIDE]] for the latest information related to +this topic.

This section outlines general internationalization considerations to take into -account when utilizing this data model. +account when utilizing this data model and is intended to highlight specific +parts of the Strings on the Web: Language and Direction Metadata +document [[STRING-META]] that implementers might be interested in reading.

-

Language Declarations

+

Language and Base Direction

-When expressing human-readable text content in the data model, it is important -for presentation, accessibility, and further processing to specify the language -of the text, as follows: +Data publishers are strongly encouraged to read the section on +Cross-Syntax Expression in the Strings on the Web: Language and Direction +Metadata document [[STRING-META]] in order to ensure that the expression +of language and/or base direction information is possible across multiple +expression syntaxes such as [[JSON-LD]], [[JSON]], and CBOR [[?RFC7049]].

-
    -
  • -[[!JSON-LD]] supports the expression of language information using the -@language feature, as described in [[!JSON-LD]] 1.1, -Section 4.2.3: String Internationalization. -
  • -
  • -[[!JSON-LD]] also supports the expression of language information using the -rdf:HTML string literal type, as described in [[!JSON-LD]] 1.0, -Section 4.2.1: Typed Values. -This mechanism enables developers to use the internationalization features -present in HTML to express language information. For example, consider the -following key-value pair: - -
    -"nameHtml": "<span lang="jp">和美</span>"
    -          
    - -

    -If the JSON-LD Context expressed that any value associated with the -nameHtml property as being of type rdf:HTML, then -software agents rendering the property can deterministically identify the -language in use. -

    -
  • -
-
+

+The general design pattern is to use the following markup template when +expressing a text string that is tagged with a language and, optionally, a +specific base direction: +

-
-

Text direction

+
+"property": {
+  "value": "The string value",
+  "lang": "LANGUAGE"
+  "dir": "DIRECTION"
+}
+      

-When expressing human-readable text content in the data model, it is important -to be able to explicitly encode the text direction. JSON and its derived formats -use the UTF-8 encoding of [[Unicode]] for serializing and transmitting text. -This enables text direction to be directly determined in simple cases, -but the mechanism is insufficient for general use. +An example utilizing the design pattern above is shown below to express the +title of a book in the English language without specifying a text direction:

+
+"title": {
+  "value": "HTML and CSS: Designing and Creating Websites",
+  "lang": "en"
+}
+      
+

-[[!JSON-LD]] supports the expression of text layout information using the -rdf:HTML string literal type, as described in [[!JSON-LD]] 1.0, -Section 4.2.1: Typed Values. -This mechanism enables developers to use the internationalization features -present in HTML to express language information. For example, consider the -following key-value pair: - -

-"nameHtml": "<span dir="rtl" lang="ar">HTML و CSS: تصميم و إنشاء مواقع الويب</span>"
+The next example uses a similar title expressed in the Arabic language with a
+base direction of right-to-left:
+      

+ +
+"title": {
+  "value": "HTML و CSS: تصميم و إنشاء مواقع الويب",
+  "lang": "ar"
+  "dir": "rtl"
+}
       
+

+The text above would most likley be rendered incorrectly as left to right +without the explicit expression of language and direction as many systems will +use the first character of a text string to determine text direction.

-If the JSON-LD Context states that any value associated with the -nameHtml property is of type rdf:HTML, then software -agents have sufficient information to deterministically identify the text -direction of the language. + +

+Implementers utilizing JSON-LD are strongly urged to +extend the JSON-LD Context defining the +internationalized property and utilize the Scoped Context feature of +JSON-LD to alias the @value, @language, and +@direction keywords to value, lang, +and dir, respectively. An example of a JSON-LD Context snippet +doing so is shown below:

+
+"title": {
+  "@context": {"value": "@value", "lang": "@language", "dir": "@direction"},
+  "@id": "https://www.w3.org/2018/credentials/examples#title"
+}
+      
+
-

Ruby Text

+

Complex Language Markup

+

-In some situations it is common to use -Ruby characters -to ensure text information is clear and as useful as possible. -[[!JSON-LD]] support for HTML data allows text to be encoded with ruby, -supporting these cases. +When multiple languages, base directions, and/or annotations are used in a +single natural language string, more complex mechanisms are typically required. +It is possible to utilize markup languages, such as HTML, to encode +text with multiple language and/or base directions. It is also +possible to use the rdf:HTML datatype to encode such values +accurately in JSON-LD. +

+ +

+Despite that possibility, implementers are strongly discouraged from encoding +information as HTML because doing so 1) requires some version of an HTML +processor, which increases the burden of processing language and/or base +direction information, and 2) increases the security attack surface when +utilizing this data model as blindly processing HTML could result in executing +a script tag that an attacker injected at some point during the +data production process.

-
-
-

Further Information

-The W3C Internationalisation document [[string-meta]] gives more information -about the need to be able to provide reliable metadata about text to support -internationalization. +If implementers feel that they have to use HTML, or other markup languages +that are capable of containing executable scripts, to achieve a particular +use case, they are advised to analyze how an attacker would use the markup to +mount injection attacks against a consumer of the markup and deploy mitigations +for the identified attacks.