Skip to content

4. Mapping software: Converting files to Gellish expressions

Andries van Renssen edited this page Nov 9, 2018 · 2 revisions

Processing non-Gellish JSON files

Data exchange according to the system independent Gellish methodology and language assumes that data (messages) are exported from and imported into applications in files or streams in Gellish Expression Format. When systems already have export or import capabilities, for example in JSON or CSV form, then such messages can be converted to and from Gellish as is described in this section.

JSON as well as CSV specify a syntax for messages, but neither of them prescribes any vocabulary with a predefined meaning (semantics) or any interpretation rules for their content. Thus the content of JSON and CSV files are therefor application dependent. This imp[lies that for every application a dedicated procedure need to be specified for interpreting and converting such files. The rules for interpretation can be specified in Gellish 'mapping tables'.

For example, the 'ib velux.JSON' file in the GellishData directory is a real life example that contains among others the following expressions:
{
"articleId":"GPU P06 0073G",
"description":"Velux Dakvenster aluminium veiligheidsglas 94x118 cm GPU P06 0073G",
"properties":{
"ibProductsoort":{
"label":"Productsoort",
"name":"ib_productsoort",
"value":"Dakramen|Ramen"
},
"breedteMm":{
"label":"Breedte (mm)",
"name":"breedte_mm",
"value":"940",
"unit":"mm"
},
"hoogteMm":{
"label":"Hoogte (mm)",
"name":"hoogte_mm",
"value":"1180",
"unit":"mm"
},
"gewichtKg":{
"label":"Gewicht (kg)",
"name":"gewicht_kg",
"value":"56,23",
"unit":"kg"
}
}

The above JSON file uses a mixture of English and Dutch terms, whereas it is clear that the terminology is application specific. A human being with knowledge of the languages might interpret the content from the terminology and the provided hierarchy, but it may be that the author or documentation should be consulted for a proper interpretation.

The content of such a JSON file can be converted into Gellish Formal English by using a Mapping Table. The above example can be converted using the 'Mappingtable - IB-roof window-UTF-8.csv' file that is also available in the GellishData directory and the method Interpret_non_gellish_JSON_file in the Expression_list class of the Gellish Communicator application. The method is an example of Mapper software that converts a non-Gellish data file into expressions in Gellish Expression Format guided by a mapping table. The mapping table contains five sub mapping tables:

  • a 'Main keys map',
  • an 'Attributes map',
  • a 'Keys for values map',
  • an Allowed values map' and
  • an 'Allowed units map'.

Those mapping tables specify Gellish uniwue identifiers (UIDs) and synonyms that map the terminology of this kind of JSON files to the Gellish Dictionary and it contains a specification of the Gellish kinds of relations that needs to be used for producing Gellish expressions. The Mapper software produces Gellish expressions that can be processed as input for extension of the semantic network in the same way as processing any other file in Gellish Expression Format. The Mapper software can also produce a Gellish file that can be exported either in JSON or CSV in UTF-8 format and can then be used in any other Gellish enabled application.
The method calls the functions in the Create_output_file.py module for actual creating and filling the output file.

From Gellish to JSON

A file in Gellish Expression Format can be expressed as a JSON file. But if the JSON file should proprietary terminology and should obey a prescribed syntax, such as the syntax and terminology of the above JSON file example, then the Gellish mapping tables can be used for an inverse conversion, because the Gellish file can be interpreted in an unambiguous way.

The Gellish website

Information about the definition and application of the Gellish family of formalized languages is available via the Gellish website.

Semantic Modeling Methodology

The book Semantic Information Modeling Methodology describes the application of Gellish formalized languages.

Language defining ontology

The book Formalized languages for Semantic Information Modeling describes the base ontology that defines Gellish formalized languages.

Clone this wiki locally