Skip to content

Commit

Permalink
fixing default sparql query target; SPDX recognition by ID
Browse files Browse the repository at this point in the history
  • Loading branch information
huberrob committed Jul 21, 2021
1 parent 4f5d8bf commit d71eca9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion fuji_server/evaluators/fair_evaluator_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ def lookup_license_by_url(self, u, metric_id):
self.logger.info('{0} : Verify URL through SPDX registry -: {1}'.format(metric_id, u))
html_url = None
isOsiApproved = False
ul = None
if 'spdx.org/licenses' in u:
ul = u.split('/')[-1]
for item in self.fuji.SPDX_LICENSES:
# u = u.lower()
# if any(u in v.lower() for v in item.values()):
licenseId = item.get('licenseId')
seeAlso = item.get('seeAlso')
if any(u in v for v in seeAlso):
if any(u in v for v in seeAlso) or licenseId == ul:
self.logger.info('{0} : Found SPDX license representation -: {1}'.format(metric_id, item['detailsUrl']))
# html_url = '.html'.join(item['detailsUrl'].rsplit('.json', 1))
html_url = item['detailsUrl'].replace(".json", ".html")
Expand Down
2 changes: 1 addition & 1 deletion fuji_server/helper/metadata_collector_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_metadata(self,g, item, type='Dataset'):
DCAT = Namespace("http://www.w3.org/ns/dcat#")
meta = dict()
#default sparql
met = self.get_default_metadata(item)
meta = self.get_default_metadata(g)
meta['object_identifier'] = (g.value(item, DC.identifier) or g.value(item, DCTERMS.identifier))
'''
if self.source_name != self.getEnumSourceNames().RDFA.value:
Expand Down

0 comments on commit d71eca9

Please sign in to comment.