Skip to content

Commit

Permalink
Add a dct:type to dt:LicenseDocuement to make the validation happy
Browse files Browse the repository at this point in the history
TODO: add a field to handle this or guess it from the CKAN license
model
  • Loading branch information
amercader committed Jul 16, 2024
1 parent 9c3a68a commit 1aa6e0f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ckanext/dcat/profiles/euro_dcat_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ def graph_from_dataset(self, dataset_dict, dataset_ref):
self._add_list_triples_from_dict(resource_dict, distribution, items)

# Set default license for distribution if needed and available

if resource_license_fallback and not (distribution, DCT.license, None) in g:
g.add(
(
Expand All @@ -493,6 +494,15 @@ def graph_from_dataset(self, dataset_dict, dataset_ref):
URIRefOrLiteral(resource_license_fallback),
)
)
# TODO: add an actual field to manage this
if (distribution, DCT.license, None) in g:
g.add(
(
list(g.objects(distribution, DCT.license))[0],
DCT.type,
URIRef("http://purl.org/adms/licencetype/UnknownIPR")
)
)

# Format
mimetype = resource_dict.get("mimetype")
Expand Down

0 comments on commit 1aa6e0f

Please sign in to comment.