Skip to content

Commit ae1ec75

Browse files
committed
feat: Output multilingual labels on relations in graph
1 parent 1931594 commit ae1ec75

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ckanext/dcatapchharvest/profiles.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,16 +863,20 @@ def graph_from_dataset(self, dataset_dict, dataset_ref): # noqa
863863
if dataset_dict.get('relations'):
864864
relations = dataset_dict.get('relations')
865865
for relation in relations:
866-
relation_name = relation['label']
867866
try:
868867
relation_url = dh.uri_to_iri(relation['url'])
869868
except ValueError:
870869
# skip this relation if the URL is invalid
871870
continue
872871

873-
relation = URIRef(relation_url)
874-
g.add((relation, RDFS.label, Literal(relation_name)))
875-
g.add((dataset_ref, DCT.relation, relation))
872+
relation_uriref = URIRef(relation_url)
873+
self._add_multilang_value(
874+
relation_uriref,
875+
RDFS.label,
876+
'label',
877+
relation
878+
)
879+
g.add((dataset_ref, DCT.relation, relation_uriref))
876880

877881
# References
878882
if dataset_dict.get('see_alsos'):

0 commit comments

Comments
 (0)