Skip to content
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

Add lang & dir to all relevant schemas #190

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 1.0-draft/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ <h3>Text-processing language</h3>

<p>All objects used in this protocol (entities, types, properties, queries, candidates, features, etc.) MAY declare an explicit <a>text-processing language</a> in a <code>lang</code> field.
The <code>lang</code> value MUST be a single valid (i.e. found in the [[IANA Language Subtag Registry]]) [[BCP 47]] language tag. This text-processing language applies to the natural language fields of the object: <code>name</code>, <code>description</code>,
<code>query</code> (for <a>reconciliation queries</a>), <code>v</code> and <code>str</code> (for <a>property values</a>). Nested objects inherit the text-processing language of their parent, and can override it by setting their own <code>lang</code> value
<code>query</code> (for <a>reconciliation queries</a>), <code>v</code> and <code>str</code> (for <a>property values</a>), <code>helpText</code> (for <a>data extension property settings</a>). Nested objects inherit the text-processing language of their parent, and can override it by setting their own <code>lang</code> value
(see example below). A default text-processing language for any natural language string returned or processed by a service MAY be set in the <code>lang</code> field of the <a href="#service-manifest">service manifest</a>.
Client and service implementors SHOULD consider the text-processing language to ensure correct processing of natural language content.</p>

Expand All @@ -977,7 +977,7 @@ <h3>Text direction</h3>

<p>All objects returned by reconciliation services (entities, types, properties, candidates, features, etc.) MAY declare an explicit text <a href="https://www.w3.org/International/articles/inline-bidi-markup/uba-basics">
base direction</a> in a <code>dir</code> field. The <code>dir</code> value MUST be <code>ltr</code> for left-to-right, <code>rtl</code> for right-to-left, or <code>auto</code> for determining the direction by examining the content of each JSON field.
This base direction applies to the natural language fields of the object: <code>name</code> and <code>description</code> (for candidates etc.), <code>v</code> and <code>str</code> (for <a>property values</a>).
This base direction applies to the natural language fields of the object: <code>name</code> and <code>description</code> (for candidates etc.), <code>v</code> and <code>str</code> (for <a>property values</a>), <code>helpText</code> (for <a>data extension property settings</a>).
Nested objects inherit the base direction of their parent, and can override it by setting their own <code>dir</code> value. A default base direction for any natural language string returned or processed by a service MAY be set in the <code>dir</code> field of the
<a href="#service-manifest">service manifest</a>. If no explicit base direction is given, left-to-right is considered the default base direction. Clients SHOULD consider the base direction to ensure correct rendering of content, e.g. by setting corresponding <code>dir</code> attributes when rendering JSON responses in HTML.
For instance, rendering a Persian label for 'Yahoo!' like <code>یاهو!</code> right-to-left will correctly display as <code dir="rtl">یاهو!</code>.</p>
Expand Down
6 changes: 6 additions & 0 deletions 1.0-draft/schemas/data-extension-property-proposal.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"description": {
"type": "string",
"description": "An optional description which can be provided to disambiguate namesakes, providing more context."
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down
20 changes: 16 additions & 4 deletions 1.0-draft/schemas/data-extension-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
"name": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"type": {
"type": "object",
"properties": {
Expand All @@ -23,6 +29,12 @@
},
"name": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down Expand Up @@ -81,10 +93,10 @@
"type": "string"
},
"lang": {
"type": "string"
"$ref": "lang.json"
},
"dir": {
"type": "string"
"$ref": "dir.json"
}
},
"required": [
Expand All @@ -100,10 +112,10 @@
"type": "string"
},
"lang": {
"type": "string"
"$ref": "lang.json"
},
"dir": {
"type": "string"
"$ref": "dir.json"
}
},
"required": [
Expand Down
10 changes: 10 additions & 0 deletions 1.0-draft/schemas/dir.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$id": "https://reconciliation-api.github.io/specs/draft/schemas/dir.json",
"type": "string",
"enum": [
"ltr",
"rtl",
"auto"
],
"description": "The text direction for the natural language fields of this object"
}
5 changes: 5 additions & 0 deletions 1.0-draft/schemas/lang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$id": "https://reconciliation-api.github.io/specs/draft/schemas/lang.json",
"type": "string",
"description": "The text-processing language for the natural language fields of this object"
}
36 changes: 36 additions & 0 deletions 1.0-draft/schemas/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"type": "string",
"description": "A human-readable name for the service or data source"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"documentation": {
"type": "string",
"description": "A URI which hosts documentation about this service"
Expand Down Expand Up @@ -136,6 +142,12 @@
},
"helpText": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down Expand Up @@ -165,6 +177,12 @@
},
"helpText": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down Expand Up @@ -194,6 +212,12 @@
},
"helpText": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down Expand Up @@ -224,6 +248,12 @@
"helpText": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"choices": {
"type": "array",
"items": {
Expand All @@ -234,6 +264,12 @@
},
"name": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down
12 changes: 10 additions & 2 deletions 1.0-draft/schemas/reconciliation-query-batch.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
},
"name": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down Expand Up @@ -52,8 +58,10 @@
"description": "The maximum number of candidates to return"
},
"lang": {
"type": "string",
"description": "The text-processing language for the query"
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"conditions": {
"type": "array",
Expand Down
18 changes: 18 additions & 0 deletions 1.0-draft/schemas/reconciliation-result-batch.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
"type": "string",
"description": "Optional description of the candidate entity"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"score": {
"type": "number",
"description": "Number indicating how likely it is that the candidate matches the query"
Expand All @@ -48,6 +54,12 @@
"type": "string",
"description": "A human-readable name for the feature"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"value": {
"description": "The value of the feature for this reconciliation candidate",
"oneOf": [
Expand Down Expand Up @@ -85,6 +97,12 @@
},
"name": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down
12 changes: 12 additions & 0 deletions 1.0-draft/schemas/suggest-entities-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"type": "string",
"description": "An optional description which can be provided to disambiguate namesakes, providing more context."
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"notable": {
"type": "array",
"description": "Types the suggest entity belongs to",
Expand All @@ -35,6 +41,12 @@
},
"name": {
"type": "string"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down
12 changes: 12 additions & 0 deletions 1.0-draft/schemas/suggest-properties-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"type": "string",
"description": "An optional description which can be provided to disambiguate namesakes, providing more context."
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"matchQualifiers": {
"type": "array",
"description": "An optional array of objects representing the matchQualifiers supported for the suggested property",
Expand All @@ -34,6 +40,12 @@
"name": {
"type": "string",
"description": "Name of the matchQualifier"
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
}
},
"required": [
Expand Down
6 changes: 6 additions & 0 deletions 1.0-draft/schemas/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"type": "string",
"description": "An optional description which can be provided to disambiguate namesakes, providing more context."
},
"lang": {
"$ref": "lang.json"
},
"dir": {
"$ref": "dir.json"
},
"broader": {
"type": "array",
"description": "An optional array of types, each representing a direct (i.e., immediate) broader category of entities.",
Expand Down