Code Monkey home page Code Monkey logo

Comments (6)

adriankast avatar adriankast commented on June 2, 2024

The reason is that the content of the title property (and description) is not found in the multilang version. Thus the error message

root_title is not on the multilang object at the same level

I don't no why or if this behaviour is wanted, but it has been there before I touched the code...so it seemed to be a feature not a bug ;)

If you use the TD below the validation says valid (added en tags with corresponding content):

{
   "@context":[
      "https://www.w3.org/2019/wot/td/v1",
      {
         "cov":"http://www.example.org/coap-binding#"
      },
      {
         "saref":"https://w3id.org/saref#"
      }
   ],
   "securityDefinitions":{
      "basic_schema":{
         "scheme":"basic",
         "descriptions":{

         },
         "description":"Basic sec schema",
         "in":"query",
         "name":"querykey"
      }
   },
   "security":[
      "basic_schema"
   ],
   "@type":[
      "saref:LightSwitch"
   ],
   "titles":{
      "de":"Deutscher Titel",
      "en": "English title"
   },
   "title":"English title",
   "descriptions":{
      "de":"Deutsche Beschreibung",
      "en": "English description"
   },
   "description":"English description",
   "properties":{
      "echo":{
         "observable":false,
         "forms":[
            {
               "op":[
                  "readproperty"
               ],
               "href":"/echo",
               "contentType":"application/json"
            }
         ]
      }
   }
}

from playground.

egekorkan avatar egekorkan commented on June 2, 2024

The TD spec says:

When title and titles or description and descriptions are present in a TD document, each title and description member SHOULD have a corresponding titles and descriptions member, respectively.

Thus, the current behavior of the playground is correct. @Citrullin sadly your TD was not correct but this is a really detailed case where I am pretty sure anyone in the working group can make. Even I didn't remember this requirement, even though I have created the validation case.

Somewhat related issue here: w3c/wot-thing-description#959

from playground.

egekorkan avatar egekorkan commented on June 2, 2024

Closing since even the error message is accurate, @Citrullin you can reopen it if you need to :)

from playground.

Citrullin avatar Citrullin commented on June 2, 2024

The TD spec says:

When title and titles or description and descriptions are present in a TD document, each title and description member SHOULD have a corresponding titles and descriptions member, respectively.

Thus, the current behavior of the playground is correct. @Citrullin sadly your TD was not correct but this is a really detailed case where I am pretty sure anyone in the working group can make. Even I didn't remember this requirement, even though I have created the validation case.

Somewhat related issue here: w3c/wot-thing-description#959

Okay, I get that. But why do I need to duplicate data? This seems not very intuitive to me. Why not making the titles and descriptions property mandatory and have some kind of default lang in the thing itself?

from playground.

egekorkan avatar egekorkan commented on June 2, 2024

Why not making the titles and descriptions property mandatory and have some kind of default lang in the thing itself?

That is quite interesting and if you need to declare a default language, there is even more redundant information, the TD would have the following @context

{
   "@context":[
      "https://www.w3.org/2019/wot/td/v1",
      { "@language" : "en" }
   ],
...
}

In this TD, all the title and description should contain english text. I think relying on this mechanism and removing title would create more effort on TD processors but I personnaly do not care too much about Consumers requiring more resources, the Things should be optimized first I think.

Should this be a question/issue for the TD Task Force? What do you think @sebastiankb :)

from playground.

egekorkan avatar egekorkan commented on June 2, 2024

closing since the linked TD issue should result on something first. Can be reopened if needed

from playground.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.