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

Fix ContentEncoding and ContentMediaType #1157

Merged
merged 3 commits into from
Jun 17, 2021
Merged
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
122 changes: 80 additions & 42 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1550,8 +1550,6 @@ <h2>Data Schema Vocabulary Definitions</h2>
<tr class="rfc2119-table-assertion" id="td-vocab-format--DataSchema"><td><code>format</code></td><td>Allows validation based on a format pattern
such as "date-time", "email", "uri", etc. (Also see
below.)</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#string"><code>string</code></a></td></tr>
<tr class="rfc2119-table-assertion" id="td-vocab-contentEncoding--DataSchema"><td><code>contentEncoding</code></td><td>Specifies the encoding used to store the contents, as specified in RFC 2054. The values that are accepted: "7bit", "8bit", "binary", "quoted-printable" and "base64".</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#string"><code>string</code></a></td></tr>
<tr class="rfc2119-table-assertion" id="td-vocab-contentMediaType--DataSchema"><td><code>contentMediaType</code></td><td>Specifies the MIME type (e.g., image/png, audio/mpeg) of the contents of a string value, as described in RFC 2046.</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#string"><code>string</code></a></td></tr>
<tr class="rfc2119-table-assertion" id="td-vocab-type--DataSchema"><td><code>type</code></td><td>Assignment of JSON-based data types compatible
with JSON Schema (one of boolean, integer, number,
string, object, array, or null).</td><td>optional</td><td>any type (one of <code>object</code>, <code>array</code>, <code>string</code>, <code>number</code>, <code>integer</code>, <code>boolean</code>, or <code>null</code>)</td></tr></tbody></table><p>The class <code>DataSchema</code> has the following subclasses:</p><ul><li><a href="#arrayschema"><code>ArraySchema</code></a></li>
Expand Down Expand Up @@ -1625,7 +1623,9 @@ <h2>Data Schema Vocabulary Definitions</h2>
value <code>string</code> assigned to <code>type</code>
in <code>DataSchema</code> instances.</p><table class="def"><thead><tr><th><a>Vocabulary term</a></th><th>Description</th><th>Assignment</th><th>Type</th></tr></thead><tbody><tr class="rfc2119-table-assertion" id="td-vocab-minLength--StringSchema"><td><code>minLength</code></td><td>Specifies the minimum length of a string. Only applicable for associated string types.</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#unsignedInt"><code>unsignedInt</code></a></td></tr>
<tr class="rfc2119-table-assertion" id="td-vocab-maxLength--StringSchema"><td><code>maxLength</code></td><td>Specifies the maximum length of a string. Only applicable for associated string types.</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#unsignedInt"><code>unsignedInt</code></a></td></tr>
<tr class="rfc2119-table-assertion" id="td-vocab-pattern--StringSchema"><td><code>pattern</code></td><td>Provides a regular expressions to express constraints of the string value. The regular expression must follow the [[ECMA-262]] dialect.</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#string"><code>string</code></a></td></tr></tbody></table></section>
<tr class="rfc2119-table-assertion" id="td-vocab-pattern--StringSchema"><td><code>pattern</code></td><td>Provides a regular expressions to express constraints of the string value. The regular expression must follow the [[ECMA-262]] dialect.</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#string"><code>string</code></a></td></tr>
<tr class="rfc2119-table-assertion" id="td-vocab-contentEncoding--StringSchema"><td><code>contentEncoding</code></td><td>Specifies the encoding used to store the contents, as specified in RFC 2054.</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#string"><code>string</code></a> (e.g., <code>7bit</code>, <code>8bit</code>, <code>binary</code>, <code>quoted-printable</code>, or <code>base64</code>)</td></tr>
<tr class="rfc2119-table-assertion" id="td-vocab-contentMediaType--StringSchema"><td><code>contentMediaType</code></td><td>Specifies the MIME type of the contents of a string value, as described in RFC 2046.</td><td>optional</td><td><a href="http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#string"><code>string</code></a> (e.g., <code>image/png</code>, or <code>audio/mpeg</code>)</td></tr></tbody></table></section>
<section><h3><code>NullSchema</code></h3><p>Metadata describing data of type <code>null</code>.
This <a href="#dfn-subclass" class="internalDFN" data-link-type="dfn">Subclass</a> is indicated by the
value <code>null</code> assigned to <code>type</code> in
Expand Down Expand Up @@ -6466,8 +6466,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
</p>
<pre class="advisement">
{
"title": "WoT TD Schema - 16 February 2021",
"description": "JSON Schema for validating TD instances against the TD model. TD instances can be with or without terms that have default values",
"title": "WoT TD Schema - 02 June 2021",
"description": "JSON Schema for validating TD instances against the TD information model. TD instances can be with or without terms that have default values",
"$schema ": "http://json-schema.org/draft-07/schema#",
"definitions": {
"anyUri": {
Expand All @@ -6493,7 +6493,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
}
},
"security": {
"oneOf": [{
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
Expand All @@ -6505,7 +6506,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
]
},
"scopes": {
"oneOf": [{
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
Expand All @@ -6518,7 +6520,7 @@ <h1>JSON Schema for TD Instance Validation</h1>
},
"subprotocol": {
"type": "string",
"enum": [
"examples": [
"longpoll",
"websub",
"sse"
Expand All @@ -6532,13 +6534,17 @@ <h1>JSON Schema for TD Instance Validation</h1>
]
},
"thing-context": {
"oneOf": [{
"oneOf": [
{
"type": "array",
"items": [{
"$ref": "#/definitions/thing-context-w3c-uri"
}],
"items": [
{
"$ref": "#/definitions/thing-context-w3c-uri"
}
],
"additionalItems": {
"anyOf": [{
"anyOf": [
{
"$ref": "#/definitions/anyUri"
},
{
Expand All @@ -6553,15 +6559,20 @@ <h1>JSON Schema for TD Instance Validation</h1>
]
},
"type_declaration": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"not": {"const":"tm:ThingModel"}
"not": {
"const": "tm:ThingModel"
}
},
{
"type": "array",
"items": {
"type": "string",
"not": {"const":"tm:ThingModel"}
"not": {
"const": "tm:ThingModel"
}
}
}
]
Expand Down Expand Up @@ -6608,10 +6619,10 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "string"
},
"const": {},
"contentEncoding":{
"contentEncoding": {
"type": "string"
},
"contentMediaType":{
"contentMediaType": {
"type": "string"
},
"type": {
Expand All @@ -6627,7 +6638,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
]
},
"items": {
"oneOf": [{
"oneOf": [
{
"$ref": "#/definitions/dataSchema"
},
{
Expand All @@ -6652,16 +6664,23 @@ <h1>JSON Schema for TD Instance Validation</h1>
"maximum": {
"type": "number"
},
"minLength":{
"minLength": {
"type": "integer",
"minimum": 0
},
"maxLength":{
"maxLength": {
"type": "integer",
"minimum": 0
},
"multipleOf":{
"oneOf":[{"type": "integer"},{"type": "number"}]
"multipleOf": {
"oneOf": [
{
"type": "integer"
},
{
"type": "number"
}
]
},
"properties": {
"additionalProperties": {
Expand All @@ -6680,7 +6699,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "object",
"properties": {
"op": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"enum": [
"readproperty",
Expand Down Expand Up @@ -6753,7 +6773,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "object",
"properties": {
"op": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"enum": [
"invokeaction"
Expand Down Expand Up @@ -6820,7 +6841,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "object",
"properties": {
"op": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"enum": [
"subscribeevent",
Expand Down Expand Up @@ -6889,7 +6911,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "object",
"properties": {
"op": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"enum": [
"readallproperties",
Expand Down Expand Up @@ -7033,7 +7056,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
]
},
"items": {
"oneOf": [{
"oneOf": [
{
"$ref": "#/definitions/dataSchema"
},
{
Expand All @@ -7058,16 +7082,23 @@ <h1>JSON Schema for TD Instance Validation</h1>
"maximum": {
"type": "number"
},
"minLength":{
"minLength": {
"type": "integer",
"minimum": 0
},
"maxLength":{
"maxLength": {
"type": "integer",
"minimum": 0
},
"multipleOf":{
"oneOf":[{"type": "integer"},{"type": "number"}]
"multipleOf": {
"oneOf": [
{
"type": "integer"
},
{
"type": "number"
}
]
},
"properties": {
"additionalProperties": {
Expand Down Expand Up @@ -7251,12 +7282,16 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "string",
"pattern": "[0-9]*x[0-9]+"
}
}
},
"required": [
"rel"
]
}
]
},
"securityScheme": {
"oneOf": [{
"oneOf": [
{
"type": "object",
"properties": {
"@type": {
Expand Down Expand Up @@ -7307,12 +7342,13 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "array",
"minItems": 2,
"items": {
"type": "string"
"type": "string"
}
}
},
"required": [
"scheme"
"scheme",
"oneOf"
]
},
{
Expand Down Expand Up @@ -7340,12 +7376,13 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "array",
"minItems": 2,
"items": {
"type": "string"
"type": "string"
}
}
},
"required": [
"scheme"
"scheme",
"allOf"
]
},
{
Expand Down Expand Up @@ -7576,7 +7613,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"$ref": "#/definitions/anyUri"
},
"scopes": {
"oneOf": [{
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
Expand Down Expand Up @@ -7697,7 +7735,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"format": "date-time"
},
"security": {
"oneOf": [{
"oneOf": [
{
"type": "string"
},
{
Expand All @@ -7723,8 +7762,7 @@ <h1>JSON Schema for TD Instance Validation</h1>
"@context"
],
"additionalProperties": true
}
</pre>
} </pre>

</section>

Expand Down
39 changes: 25 additions & 14 deletions validation/td-validation.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1511,20 +1511,6 @@
sh:maxCount 1 ;
sh:order 13 ;
] ;
sh:property [
sh:path jsonschema:contentEncoding ;
skos:definition """Specifies the encoding used to store the contents, as specified in RFC 2054. The values that are accepted: \"7bit\", \"8bit\", \"binary\", \"quoted-printable\" and \"base64\"."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:order 14 ;
] ;
sh:property [
sh:path jsonschema:contentMediaType ;
skos:definition """Specifies the MIME type (e.g., image/png, audio/mpeg) of the contents of a string value, as described in RFC 2046."""^^rdf:HTML ;
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:order 15 ;
] ;
skos:scopeNote """<p>The <code>format</code> string values are known from a
fixed set of values and their corresponding format rules
defined in [<cite><a class="bibref" data-link-type="biblio" href="#bib-json-schema" title="JSON Schema Validation: A Vocabulary for Structural Validation of JSON">JSON-SCHEMA</a></cite>]
Expand Down Expand Up @@ -1734,6 +1720,31 @@
sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:order 3 ;
] ;
sh:property [
sh:path jsonschema:contentEncoding ;
skos:definition """Specifies the encoding used to store the contents, as specified in RFC 2054."""^^rdf:HTML ;
sh:datatype xsd:string ;
skos:example (
"7bit"
"8bit"
"binary"
"quoted-printable"
"base64"
);
sh:maxCount 1 ;
sh:order 4 ;
] ;
sh:property [
sh:path jsonschema:contentMediaType ;
skos:definition """Specifies the MIME type of the contents of a string value, as described in RFC 2046."""^^rdf:HTML ;
sh:datatype xsd:string ;
skos:example (
"image/png"
"audio/mpeg"
);
sh:maxCount 1 ;
sh:order 5 ;
] .

:NullSchemaShape a sh:NodeShape ;
Expand Down