Skip to content

Commit

Permalink
feat: Output see_alsos if we have them
Browse files Browse the repository at this point in the history
The field is deprecated but we can still output them here.
  • Loading branch information
bellisk committed Nov 2, 2023
1 parent 7d15169 commit f54a102
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions ckanext/dcatapchharvest/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,6 @@ def _qualified_relations(self, subject):
"had_role": self._object_value(relation_node, DCAT.hadRole),
})

see_alsos = self._object_value_list(subject, RDFS.seeAlso)
for see_also in see_alsos:
permalink = dh.get_permalink(see_also)
qualified_relations.append({
"relation": permalink,
"had_role": "http://www.iana.org/assignments/relation/related"
})

return qualified_relations

def _license_rights_name(self, subject, predicate):
Expand Down Expand Up @@ -517,6 +509,10 @@ def parse_dataset(self, dataset_dict, dataset_ref): # noqa
dataset_dict['temporals'] = self._temporals(dataset_ref)

# References
see_alsos = self._object_value_list(dataset_ref, RDFS.seeAlso)
for see_also in see_alsos:
dataset_dict['see_alsos'].append({'dataset_identifier': see_also})

dataset_dict["qualified_relations"] = self._qualified_relations(
dataset_ref
)
Expand Down

0 comments on commit f54a102

Please sign in to comment.