@@ -107,17 +107,12 @@ def graph_from_dataset(self, dataset_dict, dataset_ref):
107
107
# dcat:landingPage
108
108
g .add ((dataset_ref , DCAT .landingPage , URIRef (dataset_ref )))
109
109
110
- # dcatap:applicableLegislation
111
- g .add ((dataset_ref , DCATAP .applicableLegislation , URIRef ('http://data.europa.eu/eli/reg_impl/2023/138/oj' )))
112
-
113
- # dcatap:hvdCategory
114
- hvd_category = None
115
- groups = self ._get_dataset_value (dataset_dict , 'groups' )
116
- for group in groups :
117
- hvd_category = self .hvd_category_mapping [group ['name' ]]
118
- if hvd_category :
119
- g .add ((dataset_ref , DCATAP .hvdCategory , URIRef (hvd_category )))
120
- break # ignore further groups and thus set only one HVD category
110
+ # dcatap:hvdCategory and dcatap:applicableLegislation
111
+ extras = self ._get_dataset_value (dataset_dict , 'extras' )
112
+ hvd_category = next ((d ['value' ] for d in extras if d ['key' ] == 'hvd_category' ), None )
113
+ if hvd_category is not None :
114
+ g .add ((dataset_ref , DCATAP .hvdCategory , URIRef (hvd_category )))
115
+ g .add ((dataset_ref , DCATAP .applicableLegislation , URIRef ('http://data.europa.eu/eli/reg_impl/2023/138/oj' )))
121
116
122
117
for prefix , namespace in namespaces .items ():
123
118
g .bind (prefix , namespace )
@@ -235,12 +230,10 @@ def graph_from_dataset(self, dataset_dict, dataset_ref):
235
230
236
231
def enhance_resource (self , g , distribution_ref , resource_dict , dist_additons , hvd_category ):
237
232
238
- # dcatap:applicableLegislation
239
- g .add ((distribution_ref , DCATAP .applicableLegislation , URIRef ('http://data.europa.eu/eli/reg_impl/2023/138/oj' )))
240
-
241
- # dcatap:hvdCategory
242
- if hvd_category :
233
+ # dcatap:hvdCategory and dcatap:applicableLegislation
234
+ if hvd_category is not None :
243
235
g .add ((distribution_ref , DCATAP .hvdCategory , URIRef (hvd_category )))
236
+ g .add ((distribution_ref , DCATAP .applicableLegislation , URIRef ('http://data.europa.eu/eli/reg_impl/2023/138/oj' )))
244
237
245
238
# adms:status
246
239
g .add ((distribution_ref , ADMS .status , URIRef ('http://purl.org/adms/status/Completed' )))
0 commit comments