Skip to content
Snippets Groups Projects
Commit 707a741e authored by Evert Bouman's avatar Evert Bouman
Browse files

Small changes to docker configuration

parent a6d8a10e
No related branches found
No related tags found
No related merge requests found
......@@ -7,5 +7,5 @@ services:
image: fair-client
container_name: fair-client
ports:
- ${CLIENT_PORT:-8501}:8501
- ${CLIENT_PORT:-80}:8501
restart: always
......@@ -3,7 +3,7 @@ import matplotlib.pyplot as plt
import json
## questions based on https://github.com/au-research/FAIR-Data-Assessment-Tool
## published under and open source GNU GPLv3 license
## published under and open source GNU GPLv3 license
class FAIR_assessment():
......@@ -18,7 +18,7 @@ class FAIR_assessment():
value='')
self.name_of_author = st.text_input('Name of assessor: ',
value='')
self.date_of_assessment = st.date_input('Date of assessment: ',
self.date_of_assessment = st.date_input('Date of assessment: ',
value='today')
self.link_to_dataset = st.text_input('Link to dataset: ',
value='')
......@@ -29,13 +29,13 @@ class FAIR_assessment():
'Web Address (URL)': 0.5,
'Local Identifier': 0.1,
'No Identifier': 0}},
'F2':{'question':'How is the data described with metadata?',
'answer':{'Comprehensively using a formal machine-readable metadata schema': 1,
'Comprehensively, but in a text-based, non-standard format': 0.5,
'Brief title and description': 0.1,
'The data is not described': 0}},
'F3':{'question':'Is the dataset identifier included in all metadata records/files describing the data?',
'answer':{'Yes': 1,
'No': 0}},
......@@ -55,7 +55,7 @@ class FAIR_assessment():
'Unspecified conditional access e.g. contact the data custodian for access ': 0.1,
'Access to metadata only ': 0.1,
'No access to data or metadata ': 0}},
'A1.2':{'question':'Is the data available online without requiring specialised protocols or tools once access has been approved?',
'answer':{'Standard web service API (e.g. OGC) ': 1,
'Non-standard web service (e.g. OpenAPI/Swagger/informal API) ': 0.5,
......@@ -78,25 +78,25 @@ class FAIR_assessment():
'Standardised vocabularies/ontologies/schema without global identifiers ': 0.5,
'No standards have been applied in the description of data elements ': 0.1,
'Data elements not described ': 0}},
'I3':{'question':'How is the metadata linked to other data and metadata (to enhance context and clearly indicate relationships)?',
'answer':{'Metadata is represented in a machine readable format, e.g. in a linked data format such as Resource Description Framework (RDF). ': 1,
'The metadata record includes URI links to related metadata, data and definitions ': 0.5,
'There are no links to other metadata ': 0}},
'R1.1':{'question':'Which of the following best describes the license/usage rights attached to the data?',
'answer':{'Standard machine-readable license (e.g. Creative Commons) ': 1,
'Standard text based license ': 0.5,
'Non-standard machine-readable license (clearly indicating under what conditions the data may be reused) ': 0.5,
'Non-standard text-based license ': 0.1,
'No license ': 0}},
'R1.2':{'question':'How much provenance information has been captured to facilitate data reuse?',
'answer':{'Fully recorded in a machine readable format ': 1,
'Fully recorded in a text format ': 0.5,
'Partially recorded ': 0.1,
'No provenance information is recorded ': 0}},
'R1.3':{'question':'Is the (meta)data meeting domain-relevant community standards?',
'answer':{'The data follows well-established and standardised format and documentation': 1,
'The data follows general non-domain-relevant format and documentation': 0.5,
......@@ -116,7 +116,7 @@ class FAIR_assessment():
index = len(self.QA_dict[Q]['answer'])-1,
)
self.fairness_score[Q] = self.QA_dict[Q]['answer'][self.widget_dict[Q]]
self.plot()
self.save()
......@@ -156,24 +156,24 @@ class FAIR_assessment():
scale_max = [scale_factor for y_i in y]
self.fig, ax = plt.subplots(figsize = (10,1), dpi=300)
ax.set(title = 'FAIR assessement of dataset '+ self.name_of_dataset,
xlabel='FAIR principles',
ylabel = 'Dataset',)
ax.grid(True)
ax.set_axisbelow(True)
max_val = ax.scatter(x,y2,
max_val = ax.scatter(x,y2,
marker='o',
s=scale_max,
facecolors='none',
s=scale_max,
facecolors='none',
edgecolors='red',
linewidths=0.1)
vals = ax.scatter(x,y2,
vals = ax.scatter(x,y2,
marker='o',
s=scale,
c=color_list,
s=scale,
c=color_list,
alpha=0.8,
edgecolors = 'none')
......@@ -183,40 +183,40 @@ class FAIR_assessment():
s=[o*1000 for o in list(scale_match.values())],
c = 'none',)
kw = dict(prop = 'sizes',
alpha = 0.5,
func = lambda x : x/1000,
kw = dict(prop = 'sizes',
alpha = 0.5,
func = lambda x : x/1000,
fmt="{x:.1f}")
legend1 = self.fig.legend(*scatter.legend_elements(**kw),
labelspacing = 1.5,
bbox_to_anchor = (0.5,-0.5),)
# color legend
markers = [plt.Line2D([0,0],[0,0],
color=color,
marker='o',
color=color,
marker='o',
linestyle='',
alpha=0.8) for color in color_match.values()]
self.fig.legend(markers,
color_match.keys(),
self.fig.legend(markers,
color_match.keys(),
bbox_to_anchor = (0.6,-0.5),
labelspacing = 1)
text_box = 'Date: '+str(self.date_of_assessment) +'\n'
if self.name_of_author != '':
text_box += 'Author: '+ self.name_of_author +'\n'
if self.link_to_dataset !='':
text_box += 'Link to dataset: '+ self.link_to_dataset +'\n'
self.fig.text(0.05,-1,'Date: '+text_box)
def save(self):
self.json_save = dict()
self.json_save['score'] = self.fairness_score
self.json_save['score'] = self.fairness_score
self.json_save['dataset'] = self.name_of_dataset
self.json_save['author'] = self.name_of_author
self.json_save['date'] = self.date_of_assessment.strftime("%Y-%m-%d")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment