[ardoJSON] Reading json labels with / 

[ardoJSON] Reading json labels with / 

  
Forge Component
(22)
Published on 2 May by Ricardo Silva
22 votes
Published on 2 May by Ricardo Silva

I would be greatful for any direction on how this module can read JSON labels that use "/" characters eg:

[
  {
    "@id": "http://opendatacommunities.org/id/geography/administration/lsoa/E01031138",
    "@type": [
      "http://opendatacommunities.org/def/ontology/admingeo/lsoa",
      "http://publishmydata.com/def/ontology/spatial/Area"
    ],
    "http://www.w3.org/2000/01/rdf-schema#label": [
      {
        "@value": "Rugby 002B E01031138",
        "@language": "en"
      }
    ],
  }
]

I want to extract certain elements to use in my app eg

#label:@value: "Rugby 002B E01031138"

but the JSON is presented with / characters that are not supported in data structure names which converts them to "_" .

JSON source example:

http://opendatacommunities.org/resource.json?uri=http%3A%2F%2Fopendatacommunities.org%2Fid%2Fgeography%2Fadministration%2Flsoa%2FE01031138

Solution

Hello,

For this case I would probably recommend you to  use the OutSystems Platform's builtin JSON Serialization and Deserialization functionality where you can specify the name of the labels as they appear in the JSON.

Any reason why you're not being able to use this functionality for this?

Another thing you could do is leverage the "JSON_Listify" functionality to read that data.

Solution