Skip to content

Commit

Permalink
fix #54, print a description for the FAIR score details view
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jan 21, 2022
1 parent 742731d commit 2d8b6a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/controllers/fair_score_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ def details_json

def get_fair
not_found if params[:ontologies].nil? || params[:ontologies].empty?
ontologies = params[:ontologies]
@ontologies = params[:ontologies]
begin
if ontologies.include? ','
@fair_scores_data = create_fair_scores_data(get_fair_combined_score(ontologies), ontologies.split(',').length)
elsif ontologies.eql? 'all'
tmp = get_fairness_json(ontologies)
if @ontologies.include? ','
@fair_scores_data = create_fair_scores_data(get_fair_combined_score(@ontologies), @ontologies.split(',').length)
elsif @ontologies.eql? 'all'
tmp = get_fairness_json(@ontologies)
@fair_scores_data = create_fair_scores_data(tmp['combinedScores'], tmp['ontologies'].keys.length)
else
@fair_scores_data = create_fair_scores_data(get_fair_score(ontologies).values.first ,1)
@rest_uri = "#{REST_URI}/ontologies/#{@ontologies}/latest_submission?display=all"
@fair_scores_data = create_fair_scores_data(get_fair_score(@ontologies).values.first,1)
end
rescue NameError
raise StandardError, 'Error: load failed'
Expand Down
7 changes: 7 additions & 0 deletions app/views/fair_score/_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
%a.nav-link.my-1.ml-3.text-dark{href:"#"+question[0]}
=question[0]
%div.col-9#fair-details-content{style:"overflow: scroll;height: 70vh;"}
%div.alert.alert-light
- mod_link =link_to "MOD1.4", "https://github.com/sifrproject/MOD-Ontology"
- submission_link =link_to "see the used properties",@rest_uri, target: "_blank"
%div
Metadata properties listed in the following are picked from #{mod_link}.
%div
This ontology repository implements #{mod_link} but does not necessity encode a metadata with the same properties (#{submission_link})
- @fair_scores_data[:criteria][:labels].each_with_index do |label , index|
%div.my-3.border{id:label}
%div.py-3.px-4
Expand Down

0 comments on commit 2d8b6a5

Please sign in to comment.