Discussion #2317

Multivalued custom attribute

Added by Daniele Francioli over 5 years ago. Updated over 4 years ago.

Status:Closed
Priority:Normal
Assignee:-

History

#1 Updated by Daniele Francioli over 5 years ago

We would like to ask your feedback on a new feature available in the Re3gistry software v1.0. This new feature is the possibility to use multi-valued custom attributes (custom attributes with the same name but potentially more than one value).

In the data import, different values are separated by a comma from the custom attribute field contained in the input file.

Example:

LocalId|ParentLocalId|CollectionLocalId|Language|Label|Definition|Description|Status|Comment|*Theme[f,t,f,t]|*UMLName[t,f,f,f]|*GovernanceLevel[t,f,f,f]

ad|||en|Addresses|||valid|First import|ad,au|Addresses|eu-legal

 

Providing multi-valued attributes in the different output formats requires some changes in these formats.

For example, for the Application schema’s XML format, the theme attribute is currently represented by a single theme element.

..

<theme id="http://inspire.ec.europa.eu/theme/tn">

<label xml:lang="en">Transport Networks</label>

</theme>

..

 

If the theme attribute is specified as multi-valued, this could be represented in 2 possible ways:

 

1) using several elements at the same level as previously the single element:
..

<theme id="http://inspire.ec.europa.eu/theme/tn">

<label xml:lang="en">Transport Networks</label>

</theme>

<theme id="http://inspire.ec.europa.eu/theme/ex">

<label xml:lang="en">Example</label>

</theme>

..

The same approach is also for the other format such as the json format:

Single value:

..

"theme": {

"id": "http://inspire.ec.europa.eu/theme/tn",

"label": {

  • "lang": "en",
  • "text": "Transport Networks"

}

},

..

Multi value:

..

"theme": {

"id": "http://inspire.ec.europa.eu/theme/tn",

"label": {

  • "lang": "en",
  • "text": "Transport Networks"

}

},

"theme": {

"id": "http://inspire.ec.europa.eu/theme/ex",

"label": {

  • "lang": "en",
  • "text": "Example"

}

},

..

This approach is for keeping backward compatibilities with the old formats.

 

2) Introduce a container for the multi-valued attributes:

..

<themes>

<theme id="http://inspire.ec.europa.eu/theme/tn">

<label xml:lang="en">Transport Networks</label>

</theme>

<theme id="http://inspire.ec.europa.eu/theme/ex">

<label xml:lang="en">Example</label>

</theme>

</themes>

..

Or in json:

..

"themes":[{

"id": "http://inspire.ec.europa.eu/theme/tn",

"label": {

  • "lang": "en",
  • "text": "Transport Networks"

}

},

{

"id": "http://inspire.ec.europa.eu/theme/ex",

"label": {

  • "lang": "en",
  • "text": "Example"

}

}]

..

 

The problem of this approach is that it is not backward compatible.


We therefore would propose to follow approach 1.

Please provide us your feedback on this proposal, in particular if you would prefer to use approach 2.
 

#2 Updated by Martin Tuchyna over 5 years ago

We would support the option 1.

#3 Updated by Tilman Brock-Hesse over 5 years ago

I would also prefer option 1, for backwards compatibility reasons.

#4 Updated by Daniele Francioli over 5 years ago

Following the comments that we received, the XML format will be provided without the container element for the multivalued custom attribute, in order to keep the backward compatibility.

However, the JSON format cannot provide more elements named with the same "key" unless they're inserted in a containing array. For this reason, the new JSON file (starting from the next version of the INSPIRE Registry Service) will not preserve the backward compatibility.

An encoding example of the new JSON format is available below:

...

"themes":[

{"theme":{
"id":"http://d01ri1201779.ies.jrc.it/theme/au",
"label":{
"lang":"en",
"text":"Administrative Units"
}
}
},
{"theme":{
"id":"http://d01ri1201779.ies.jrc.it/theme/ad",
"label":{
"lang":"en",
"text":"Addresses"
}
}
}

]

...

 

#5 Updated by Daniele Francioli about 5 years ago

  • Status changed from New to Resolved

#6 Updated by Michael Lutz over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF