3lbits / CIM4NoUtility

CIM for the Norwegian Power Utility
Creative Commons Attribution Share Alike 4.0 International
23 stars 5 forks source link

JSON-LD: use `type` and `id` aliases; maybe also `value` and `language`? #333

Open VladimirAlexiev opened 11 months ago

VladimirAlexiev commented 11 months ago

@Sveino

Should we declare aliases for the @ terms?

"id": "@id",
"type": "@type"

In this way JS developers can use JS prop paths (dotted access), eg if bay is a variable that holds an object of type Bay, you can access its URN as bay.id rather than having to use bay["@id"]

We could also do the same for value and language, then we can shorten the payload a bit:

  "dct:description": [{
      "value": "DIGIN10 CGMES v3.0 Low Voltage 1 (LV1) Core Equipment (EQ) Model",
      "language": "en"}]