From f6e6c9642299f689dbd1d76a17cede8127e0c7c1 Mon Sep 17 00:00:00 2001 From: huberrob Date: Thu, 2 Nov 2023 20:15:27 +0100 Subject: [PATCH] Fixed #449 url check in DataDownload --- fuji_server/helper/metadata_collector_rdf.py | 7 ++++++- fuji_server/helper/metadata_mapper.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fuji_server/helper/metadata_collector_rdf.py b/fuji_server/helper/metadata_collector_rdf.py index 50f564ec..79a92328 100644 --- a/fuji_server/helper/metadata_collector_rdf.py +++ b/fuji_server/helper/metadata_collector_rdf.py @@ -966,7 +966,12 @@ def get_schemaorg_metadata_from_graph(self, graph): ) schema_metadata["object_content_identifier"] = [] for dist in distribution: - durl = graph.value(dist, SMA.contentUrl) or graph.value(dist, SDO.contentUrl) + durl = ( + graph.value(dist, SMA.contentUrl) + or graph.value(dist, SMA.url) + or graph.value(dist, SDO.contentUrl) + or graph.value(dist, SDO.url) + ) dtype = graph.value(dist, SMA.encodingFormat) or graph.value(dist, SDO.encodingFormat) dsize = graph.value(dist, SMA.contentSize) or graph.value(dist, SDO.contentSize) if durl or dtype or dsize: diff --git a/fuji_server/helper/metadata_mapper.py b/fuji_server/helper/metadata_mapper.py index 326f48d7..3371f029 100644 --- a/fuji_server/helper/metadata_mapper.py +++ b/fuji_server/helper/metadata_mapper.py @@ -233,7 +233,7 @@ def flip_dict(dict_to_flip): '{related_resource: (isBasedOn."@id" || isBasedOn[0]."@id" || isBasedOn.url || isBasedOn[0].url || isBasedOn) , relation_type: \'isBasedOn\'} , ' '{related_resource: "@reverse".isBasedOn[0]."@id" || "@reverse".isBasedOn."@id" || "@reverse".isBasedOn[0].url || isBasedOn , relation_type: \'isBasisFor\'},' '{related_resource: (citation."@id" || citation[0]."@id" || citation.url || citation[0].url || citation.name || citation[0].name || citation), relation_type:\'references\'} ], ' - "object_content_identifier: (distribution[*].{url: contentUrl, type: (encodingFormat || fileFormat), size: (contentSize || fileSize), profile: schemaVersion} || [distribution.{url: contentUrl, type: (encodingFormat || fileFormat), size: (contentSize || fileSize), profile: schemaVersion}])" + "object_content_identifier: (distribution[*].{url: (contentUrl || url), type: (encodingFormat || fileFormat), size: (contentSize || fileSize), profile: schemaVersion} || [distribution.{url: (contentUrl || url), type: (encodingFormat || fileFormat), size: (contentSize || fileSize), profile: schemaVersion}])" "language: inLanguage.name || inLanguage.alternateName || inLanguage}" ) # 'related_resources: [{related_resource: isPartOf, relation_type: \'isPartOf\'}, {related_resource: isBasedOn, relation_type: \'isBasedOn\'}], ' \