Skip to content

Commit

Permalink
Fixed #449 url check in DataDownload
Browse files Browse the repository at this point in the history
  • Loading branch information
huberrob committed Nov 2, 2023
1 parent 9519c3b commit f6e6c96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion fuji_server/helper/metadata_collector_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion fuji_server/helper/metadata_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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\'}], ' \
Expand Down

0 comments on commit f6e6c96

Please sign in to comment.