Open AndreaCimminoArriaga opened 2 years ago
Yes JSON schema is correct. title
is mandatory per https://w3c.github.io/wot-thing-description/#thing. Moreover, there are two assertions that regulate and explain the usage of title
combined with titles
( td-multilanguage, td-title-description, and td-titles-descriptions). In short title
should be used as a default choice per entries inside titles
So in my case, I should write the TD as follows in order to have it valid ?
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"title" : "test1",
"titles": {
"en": "test1"
},
"id": "079637bb-87d5-4fef-9704-d556364d90ba",
"properties": {
"KnowledgeGraph": {
"forms": [
{
"href": "https://data.cogito.linkeddata.es/resources/079637bb-87d5-4fef-9704-d556364d90ba",
"type": "text/turtle"
}
]
}
},
"security": [ "nosec_sc" ],
"securityDefinitions": { "nosec_sc": { "scheme": "nosec" }}
}
So in my case, I should write the TD as follows in order to have it valid ?
{ "@context": "https://www.w3.org/2019/wot/td/v1", "title" : "test1", "titles": { "en": "test1" }, "id": "079637bb-87d5-4fef-9704-d556364d90ba", "properties": { "KnowledgeGraph": { "forms": [ { "href": "https://data.cogito.linkeddata.es/resources/079637bb-87d5-4fef-9704-d556364d90ba", "type": "text/turtle" } ] } }, "security": [ "nosec_sc" ], "securityDefinitions": { "nosec_sc": { "scheme": "nosec" }} }
Yes, that's sadly the case at the moment. You can and should also use the @language
tag to indicate the language of human readable fields in the current td. A consumer doesn't necessarily tries to make a match to find the current language.
A topic which should be re-discussed for TD 2.0
I'm validating the following TD against the JSON schema provided in the current spec
The problem is that the key
title
is mandatory according to the current schema so if a user needs to directly usetitles
instead, the TD is always incorrect since it lacks oftitle
. Is this behaviour correct? Shouldn't be possible to use eithertitle
ortitles
as equivalent keys since they are just different forms of expressing the same?