eclipse-thingweb / domus-tdd-api

Semantic storage for device metadata based on W3C Thing Description information model
https://thingweb.io
Other
4 stars 2 forks source link

Creation of TDs seems to merge @type and type #15

Open danielpeintner opened 10 hours ago

danielpeintner commented 10 hours ago

For example, If I try to add the following TD (Note: the terms @type and type for the property lampStatus are separated)

{
  "@context": [
    "https://www.w3.org/2019/wot/td/v1",
    {
      "opc": "http://opcfoundation.org/UA/",
      "iec61360": "https://webstore.iec.ch/publication/5381",
      "eclass": "https://www.eclasscontent.com/owl/v11.1",
      "@language": "en"
    }
  ],
  "id": "urn:siemens:demo:case:lamp",
  "title": "Demo Lamp Case",
  "@type": "eclass:IRDI_0173-1#01-ADP410#010",
  "securityDefinitions": {
    "nosec_sc": {
      "scheme": "nosec"
    }
  },
  "security": "nosec_sc",
  "base": "opc.tcp://192.168.120.237:4840/",
  "properties": {
    "lampStatus": {
      "title": "Provides lamp status",
      "description": "True=Lamp is on; False=Lamp is off",
      "readOnly": true,
      "type": "boolean",
      "@type": [
        "opc:Boolean",
        "iec61360:BooleanType"
      ],
      "forms": [
        {
          "op": "readproperty",
          "href": "ns=3;s=\"LED\".\"State\"",
          "opcua:nodeId": "ns=3;s=\"LED\".\"State\"",
          "opc:method": "READ"
        }
      ]
    }
  }
}

and later on I try to retrieve it again I get it back looking like the following

{ 
   //...
   "lampStatus": {
      "type": [
        "iec61360:BooleanType",
        "opc:Boolean",
        "boolean"
      ],
      "readOnly": true,
      "description": "True=Lamp is on; False=Lamp is off",
      "forms": [
        {
          "opc:method": "READ",
          "op": "readproperty",
          "href": "ns=3;s=\"LED\".\"State\"",
          "opcua:nodeId": "ns=3;s=\"LED\".\"State\""
        }
      ],
      "title": "Provides lamp status"
    }
}

The problem is that the container for @type and type are now mixed together in type

mahdanoura commented 10 hours ago

We are working on this issue here