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

Device: Non NGSI-LD conform example for controlledAsset #28

Closed
Blobonat opened this issue Jul 28, 2022 · 1 comment
Closed

Device: Non NGSI-LD conform example for controlledAsset #28

Blobonat opened this issue Jul 28, 2022 · 1 comment

Comments

@Blobonat
Copy link

Blobonat commented Jul 28, 2022

The example for controlledAsset of a Device right now is

"controlledAsset": {
        "type": "Relationship",
        "object": [
            "urn:ngsi-ld::wastecontainer-Osuna-100"
        ]
}

This usage of a list of Relationships is non conform to the current NGSI-LD specification (similar to the previous normalized NGSI-LD examples of the Road Data Model). Instead the example should look like this:

"controlledAsset": [
      {
        "type": "Relationship",
        "object":  "urn:ngsi-ld::wastecontainer-Osuna-100"
      }       
]

The datasetId can be omitted here, because there is only 1 (default) item. According to the current specification:

If no datasetId is provided, it is considered as the default Attribute instance. Thus the creation, updating, appending or deleting of Attributes without providing a datasetId only affects the default Attribute instance.

I am not sure whether

"controlledAsset": 
      {
        "type": "Relationship",
        "object":  "urn:ngsi-ld::wastecontainer-Osuna-100"
      }       

would also be valid in this case.


Additionally I saw that schema.json uses a Property annotation/description for controlledAsset:

"controlledAsset": {
          "type": "array",
          "description": "Property. Model:'https://schema.org/Text'. List of the asset(s) (building, object, etc.) controlled by the device.",
...

Shouldn't this be a Relationship?

@Blobonat Blobonat changed the title Non NGSI-LD conform example for controlledAsset Device: Non NGSI-LD conform example for controlledAsset Jul 29, 2022
@albertoabellagarcia
Copy link
Contributor

albertoabellagarcia commented Aug 5, 2022

You are right about the example (fixed)

Regarding the schema this is the current version on the schema
"controlledAsset": {
"type": "array",
"description": "Property. Model:'https://schema.org/Text'. List of the asset(s) (building, object, etc.) controlled by the device.",
"items": {
"oneOf": [
{
"type": "string",
"format": "uri"
},
{
"$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/EntityIdentifierType"
}
]
}
},

As you can see the items can be either a property or a relationship, so property has been chosen for the array. Why? No actual reason as far as I know. One has to be chosen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants