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
Changes from 1 commit
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
Prev Previous commit
fix: contentEnconding and MediaType description
move examples form description to skos:examples
relu91 committed Jun 17, 2021
commit eb024f8ff1bd6295105e4aa13895a3d61f46c6b8
120 changes: 79 additions & 41 deletions index.html
Original file line number Diff line number Diff line change
@@ -1624,8 +1624,8 @@ <h2>Data Schema Vocabulary Definitions</h2>
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>
<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. 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--StringSchema"><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></tbody></table></section>
<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
@@ -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": {
@@ -6493,7 +6493,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
}
},
"security": {
"oneOf": [{
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
@@ -6505,7 +6506,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
]
},
"scopes": {
"oneOf": [{
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
@@ -6518,7 +6520,7 @@ <h1>JSON Schema for TD Instance Validation</h1>
},
"subprotocol": {
"type": "string",
"enum": [
"examples": [
"longpoll",
"websub",
"sse"
@@ -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"
},
{
@@ -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"
}
}
}
]
@@ -6608,10 +6619,10 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "string"
},
"const": {},
"contentEncoding":{
"contentEncoding": {
"type": "string"
},
"contentMediaType":{
"contentMediaType": {
"type": "string"
},
"type": {
@@ -6627,7 +6638,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
]
},
"items": {
"oneOf": [{
"oneOf": [
{
"$ref": "#/definitions/dataSchema"
},
{
@@ -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": {
@@ -6680,7 +6699,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "object",
"properties": {
"op": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"enum": [
"readproperty",
@@ -6753,7 +6773,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "object",
"properties": {
"op": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"enum": [
"invokeaction"
@@ -6820,7 +6841,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "object",
"properties": {
"op": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"enum": [
"subscribeevent",
@@ -6889,7 +6911,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"type": "object",
"properties": {
"op": {
"oneOf": [{
"oneOf": [
{
"type": "string",
"enum": [
"readallproperties",
@@ -7033,7 +7056,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
]
},
"items": {
"oneOf": [{
"oneOf": [
{
"$ref": "#/definitions/dataSchema"
},
{
@@ -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": {
@@ -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": {
@@ -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"
]
},
{
@@ -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"
]
},
{
@@ -7576,7 +7613,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"$ref": "#/definitions/anyUri"
},
"scopes": {
"oneOf": [{
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
@@ -7697,7 +7735,8 @@ <h1>JSON Schema for TD Instance Validation</h1>
"format": "date-time"
},
"security": {
"oneOf": [{
"oneOf": [
{
"type": "string"
},
{
@@ -7723,8 +7762,7 @@ <h1>JSON Schema for TD Instance Validation</h1>
"@context"
],
"additionalProperties": true
}
</pre>
} </pre>

</section>

15 changes: 13 additions & 2 deletions validation/td-validation.ttl
Original file line number Diff line number Diff line change
@@ -1723,15 +1723,26 @@
] ;
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 ;
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 (e.g., image/png, audio/mpeg) of the contents of a string value, as described in RFC 2046."""^^rdf:HTML ;
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 ;
] .