LOD-GEOSS / databus-snippets

3 stars 1 forks source link

Overwriting of strings causes confusion #8

Closed giannou closed 2 years ago

giannou commented 2 years ago

The title defined in this line https://github.com/LOD-GEOSS/databus-snippets/blob/a05ba29ab1ac23f0c18987e761443aa05d8989fa/dev_databus_api_example.py#L246 gets overwritten here https://github.com/LOD-GEOSS/databus-snippets/blob/a05ba29ab1ac23f0c18987e761443aa05d8989fa/dev_databus_api_example.py#L299

Is that intended?

Same holds for label. https://github.com/LOD-GEOSS/databus-snippets/blob/a05ba29ab1ac23f0c18987e761443aa05d8989fa/dev_databus_api_example.py#L252 gets overwritten here https://github.com/LOD-GEOSS/databus-snippets/blob/a05ba29ab1ac23f0c18987e761443aa05d8989fa/dev_databus_api_example.py#L298

Or are there simply different values for these strings possible between group and DataID JSON-LD files?

yum-yab commented 2 years ago

Hi, I understand the confusion, but here is the explaination:

  1. You are right, the Group and Artifact have different Titles, Descriptions etc. (In the future the many will be omitted, so e.g. there will be no label, just title). So, for example, the group Animals can have a different Title then a version of the Artifact Dogs.

  2. The variable title is not overwritten but is using a python concept named named arguments. So basically title in line 299 is not the variable title from line 246 but a new variable in the constructor of the DataGroup object and can only be accessed in this constructor.