Currently I have configured a solution with Fiware-Orion + Fiware-Cygnus + CKAN.
I have the following question:
Context attributes are always stored by type, value, and metadata; in row mode, as wel as in column mode. However, I am using more complex JSON structures in the Context Broker (type 'T')
However, most standard CKAN frontend viewers cannot handle JSON attribute values.
Is there any solution available to solve this?
A similar issue exists for the metadata, which are currently stored by Cygnus in CKAN as JSON by definition.
The simplest solution would be at change the context broker data model to use flat datatypes. However, I consider this a bad solution because I don't want the context modeling to suffer from storage adapter limitations.
Another solution would be to upgrade the standard viewers and write new ones. However, the following is a more generic solution that allows me to use any CKAN viewer.
Suppose I have a ContextElement attribute with name myAttr
and value { a: 1, b: 2, c: 3}
. Currently it would be stored by the CKAN Sink as:
Row persistence mode
attrName: "myAttr"
attrValue: "{ a: 1, b: 2, c: 3}"
attrMd: "[{name: md1_name, type: md1_type, value: md1_value}, {name: md2_name, type: md2_type, value: md2_value}]"
Column persistence mode:
column: myAttr
value: { a: 1, b: 2, c: 3}
column: myAttr_md
value [{name: md1_name, type: md1_type, value: md1_value}, {name: md2_name, type: md2_type, value: md2_value}]
To solve this issue I propose the following structure:
Row persistence mode:
attrName: myAttr_a
attrType: primitive myAttr.a type
attrValue: 1
attrName: myAttr_b
attrType: primitive myAttr.b type
attrValue: 2
attrName: myAttr_c
attrType: <primitive myAttr.b type>
attrValue: 3
attrName: myAttr_md_md1_name
attrType: md1_type
attrValue: md1_value
attrName: myAttr_md_md2_name
attrType: md2_type
attrValue: md2_value
...
Opinions appreciated.