ScorpioBroker / ScorpioBroker

NGSI-LD compliant context broker named Scorpio. Developed by NEC Laboratories Europe and NEC Technologies India
BSD 3-Clause "New" or "Revised" License
62 stars 40 forks source link

Simplified Representation drops `type` #474

Closed jason-fox closed 9 months ago

jason-fox commented 1 year ago

Scorpio 4.1.10 using this context.jsonld.

I have the following normalized entity:

{
  "id": "urn:ngsi-ld:Building:farm001",
  "type": "Building",
  "address": {
    "type": "Property",
    "value": {
      "addressLocality": "Tiergarten",
      "addressRegion": "Berlin",
      "postalCode": "10557",
      "streetAddress": "Großer Stern 1"
    },
    "verified": {
      "type": "Property",
      "value": true
    }
  },
  "name": {
    "type": "Property",
    "value": "Victory Farm"
  },
  "location": {
    "type": "GeoProperty",
    "value": {
      "type": "Point",
      "coordinates": [
        13.3505,
        52.5144
      ]
    }
  },
  "category": {
    "type": "Property",
    "value": "farm"
  },
  "@context": [
    "http://context/ngsi-context.jsonld",
    "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.7.jsonld"
  ]

I make a request for simplified format as shown:

curl -L 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Building:farm001/?options=simplified' \
-H 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
-H 'Accept: application/ld+json'

I receive the following:

{
    "id": "urn:ngsi-ld:Building:farm001",
    "address": {
        "addressLocality": "Tiergarten",
        "addressRegion": "Berlin",
        "postalCode": "10557",
        "streetAddress": "Großer Stern 1"
    },
    "name": "Victory Farm",
    "location": {
        "type": "Point",
        "coordinates": [
            13.3505,
            52.5144
        ]
    },
    "category": "farm",
    "@context": [
        "http://context/ngsi-context.jsonld",
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.7.jsonld"
    ]
}

type is missing from the response.

According to the ETSI specification pages 256 et seq. type should be included in the simplified response

vivekNEC commented 1 year ago

Hi, this bug has already been fixed in https://github.com/ScorpioBroker/ScorpioBroker/tree/testsuite-bugfixes and will be merge soon. Thanks

jason-fox commented 11 months ago

Still an open issue with SCORPIO_VERSION=4.1.11

jason-fox commented 10 months ago

@vivekNEC - the issue is only partially fixed. There are four ways to specify the key-values format:

The format may be preferred, but the older options parameter should still be properly supported.

jason-fox commented 9 months ago

Fixed 4.1.15