Skip to content

Commit

Permalink
replaced dummy examples with real queries from caseologue; updated th…
Browse files Browse the repository at this point in the history
…e structure of the menu
  • Loading branch information
Claire Rioualen committed May 24, 2024
1 parent f5e0e87 commit 7025317
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 83 deletions.
107 changes: 81 additions & 26 deletions src/webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,59 +156,115 @@ def edam_last_report():

return render_template('edam_last_report.html', output_edamci_list=edamci_output_list, robot_output_list=robot_output_list)

#################################################
# How to contribute
#################################################
@app.route('/high_priority')
def high_priority():

return render_template('high_priority.html')

@app.route('/quick_curation')
def quick_curation():

dir_queries = "./queries"

## Get topics without a wikipedia link (WARNING)
query = dir_queries + "/no_wikipedia_link_topic.rq"
## Checks that all mandatory properties are filled in.
query = dir_queries + "/mandatory_property_missing.rq"
with open(query, "r") as f:
query = f.read()
results = g.query(query)
f.close()

no_wikipedia_link_topic = []
mandatory_property_missing = []
for r in results:
no_wikipedia_link_topic.append({"term": r["term"], "class": r["concept"]})
mandatory_property_missing.append({"term": r["label"], "class": r["entity"]})

## Get operations without a wikipedia link (WARNING)
query = dir_queries + "/no_wikipedia_link_operation.rq"
## Checks that all IDs have a unique number.
query = dir_queries + "/get_uri.rq"
with open(query, "r") as f:
query = f.read()
results = g.query(query)
f.close()

no_wikipedia_link_operation = []
id_unique = []
for r in results:
no_wikipedia_link_operation.append({"term": r["term"], "class": r["concept"]})
id_unique.append({"term": r["label"], "class": r["entity"]})

return render_template('high_priority.html',
mandatory_property_missing = mandatory_property_missing,
id_unique = id_unique,
random = random)

####################################
@app.route('/quick_curation')
def quick_curation():

dir_queries = "./queries"

## Get topics without any broad synonym (OPTIONAL)
query = dir_queries + "/no_broad_synonym_topic.rq"
## Checks that all webpage and doi are declared as literal links.
query = dir_queries + "/literal_links.rq"
with open(query, "r") as f:
query = f.read()
results = g.query(query)
f.close()

no_broad_synonym_topic = []
literal_links = []
for r in results:
no_broad_synonym_topic.append({"term": r["term"], "class": r["concept"]})
literal_links.append({"term": r["label"], "class": r["entity"]})

## Formatting of def and labels
# end_dot_def_missing.rq;end_dot_label.rq;end_space_annotation.rq;eol_in_annotation.rq;start_space_annotation.rq;tab_in_annotation.rq
queries = [ dir_queries + "/end_dot_def_missing.rq", dir_queries + "/end_dot_label.rq", dir_queries + "/end_space_annotation.rq", dir_queries + "/eol_in_annotation.rq",
dir_queries + "/start_space_annotation.rq", dir_queries + "/tab_in_annotation.rq"]
results = {}
for q in queries:
with open(q, "r") as f:
q = f.read()
results.update(g.query(q))
f.close()

formatting = []
for r in results:
formatting.append({"term": r["label"], "class": r["entity"]})

## Get topics without a definition (ERROR)
query = dir_queries + "/no_definition_topic.rq"
## Get topics without a wikipedia link (WARNING)
query = dir_queries + "/no_wikipedia_link_topic.rq"
with open(query, "r") as f:
query = f.read()
results = g.query(query)
f.close()

no_definition_topic = []
no_wikipedia_link_topic = []
for r in results:
no_definition_topic.append({"term": r["term"], "class": r["concept"]})
no_wikipedia_link_topic.append({"term": r["term"], "class": r["concept"]})

# ## Get operations without a wikipedia link (WARNING)
# query = dir_queries + "/no_wikipedia_link_operation.rq"
# with open(query, "r") as f:
# query = f.read()
# results = g.query(query)
# f.close()

# no_wikipedia_link_operation = []
# for r in results:
# no_wikipedia_link_operation.append({"term": r["term"], "class": r["concept"]})

# ## Get topics without any broad synonym (OPTIONAL)
# query = dir_queries + "/no_broad_synonym_topic.rq"
# with open(query, "r") as f:
# query = f.read()
# results = g.query(query)
# f.close()

# no_broad_synonym_topic = []
# for r in results:
# no_broad_synonym_topic.append({"term": r["term"], "class": r["concept"]})

# ## Get topics without a definition (ERROR)
# query = dir_queries + "/no_definition_topic.rq"
# with open(query, "r") as f:
# query = f.read()
# results = g.query(query)
# f.close()

# no_definition_topic = []
# for r in results:
# no_definition_topic.append({"term": r["term"], "class": r["concept"]})


# NO wikipedia
Expand Down Expand Up @@ -252,12 +308,11 @@ def quick_curation():
return render_template('quick_curation.html',
#count_no_wikipedia = count_no_wikipedia,
no_wikipedia_link_topic = no_wikipedia_link_topic,
no_wikipedia_link_operation = no_wikipedia_link_operation,
no_broad_synonym_topic = no_broad_synonym_topic,
no_definition_topic = no_definition_topic,
#no_regex_identifier = no_regex_identifier,
literal_links = literal_links,
formatting = formatting,
random = random)

##############################################
@app.route('/field_specific')
def field_specific():
dir_queries = "./queries"
Expand Down
6 changes: 3 additions & 3 deletions src/webapp/templates/field_specific.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
eee{% extends "layout.html" %}
{% extends "layout.html" %}

{% block nav %}
{% include 'nav.html' %}
Expand All @@ -9,10 +9,10 @@
<h1 class="title">Field specific contributions</h1>

<section class="section">
<h2 class="subtitle"> <span class="tag is-warning is-medium">{{ no_regex_identifier|length }} </span> EDAM hybrid identifiers with missing regex. </h2>
<h2 class="subtitle"> <span class="tag is-info is-medium">{{ no_regex_identifier|length }} </span> EDAM hybrid identifiers with missing regex. </h2>
<div class="buttons">
{% for item in random.sample(no_regex_identifier, 8) %}
<a href="{{ item.class }}" class="button is-outlined is-warning " target="_blank" >{{ item.term }}</a>
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-info " target="_blank" >{{ item.term }}</a>
{% endfor %}
</div>
</section>
Expand Down
28 changes: 22 additions & 6 deletions src/webapp/templates/high_priority.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,32 @@
{% block body %}

<h1 class="title">High priority</h1>

<section class="section">
<h2 class="subtitle"> <span class="tag is-danger is-medium">{{ mandatory_property_missing|length }} </span> Concepts with missing mandatory properties. </h2>
<div class="buttons">
{% if mandatory_property_missing|length < 8 %}
{% for item in mandatory_property_missing %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-danger " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% else %}
{% for item in random.sample(mandatory_property_missing, 8) %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-danger " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% endif %}
</div>
</section>

<section class="section">
<h2 class="subtitle"> <span class="tag is-danger is-medium">{{ no_definition_topic|length }} </span> EDAM topics with no definition. </h2>
<h2 class="subtitle"> <span class="tag is-danger is-medium">{{ mandatory_property_missing|length }} </span> ID numbers that are no unique. </h2>
<div class="buttons">
{% if no_definition_topic|length < 8 %}
{% for item in no_definition_topic %}
<a href="{{ item.class }}" class="button is-outlined is-danger " target="_blank" >{{ item.term }}</a>
{% if id_unique|length < 8 %}
{% for item in id_unique %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-danger " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% else %}
{% for item in random.sample(no_broad_synonym_topic, 8) %}
<a href="{{ item.class }}" class="button is-outlined is-danger " target="_blank" >{{ item.term }}</a>
{% for item in random.sample(id_unique, 8) %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-danger " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% endif %}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/webapp/templates/nav.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<aside class="menu">
<a href="{{ url_for('index') }}"><img src="https://github.com/edamontology/edamontology/raw/main/EDAM-logo-square.svg" alt="EDAM logo"></a>

<p class="menu-label">About EDAM</p>
<ul class="menu-list">
<li><a href="{{ url_for('index') }}">Home</a></li>
<li><a href="{{ url_for('current') }}">Overview</a></li>
Expand Down
12 changes: 9 additions & 3 deletions src/webapp/templates/quality.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@
<h1 class="title">Quality reports</h1>

<section class="section">
<h2 class="subtitle">To do</h2>

<h2 class="subtitle">Quality report (temp screen capture)</h2>

</section>

<nav class="level is-mobile">

<div class="content">
<figure>
<img src="/static/img/screencap_quality_report_temp.png" alt="Screenshot of the Rmd report from Caseologue tests" width="1000">
</figure>
</div>
</nav>
</section>

{% endblock %}
73 changes: 28 additions & 45 deletions src/webapp/templates/quick_curation.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,52 @@ <h1 class="title">Quick and easy tasks</h1>
<p> . </p>

<section class="section">
<h2 class="subtitle"> <span class="tag is-warning is-medium">{{ no_wikipedia_link_topic|length }} </span> EDAM topics with missing wikipedia
<h2 class="subtitle"> <span class="tag is-primary is-medium">{{ no_wikipedia_link_topic|length }} </span> EDAM topics with missing wikipedia
links. </h2>
<div class="buttons">
{% for item in random.sample(no_wikipedia_link_operation, 8) %}
{# {% for item in no_wikipedia_link_topic %}#}
<a href="{{ item.class }}" class="button is-outlined is-warning " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% if no_wikipedia_link_topic|length < 8 %}
{% for item in no_wikipedia_link_topic %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-primary " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% else %}
{% for item in random.sample(no_wikipedia_link_topic, 8) %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-primary " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% endif %}
</div>
</section>

<section class="section">
<h2 class="subtitle"> <span class="tag is-warning is-medium">{{ no_wikipedia_link_operation|length }} </span> EDAM operations with missing wikipedia
links. </h2>
<div class="buttons">
{% for item in random.sample(no_wikipedia_link_operation, 8) %}
{# {% for item in no_wikipedia_link_operation %}#}
<a href="{{ item.class }}" class="button is-outlined is-warning " target="_blank" >{{ item.term }}</a>
{% endfor %}
</div>

</section>

<section class="section">
<h2 class="subtitle"> <span class="tag is-success is-medium">{{ no_broad_synonym_topic|length }} </span> EDAM topics with no broad synonyms. </h2>
<h2 class="subtitle"> <span class="tag is-primary is-medium">{{ literal_links|length }} </span> EDAM concepts have webpage and/or DOI not declared as literal links </h2>
<div class="buttons">
{% for item in random.sample(no_broad_synonym_topic, 8) %}
{# {% for item in no_wikipedia_link_operation %}#}
<a href="{{ item.class }}" class="button is-outlined is-success " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% if literal_links|length < 8 %}
{% for item in literal_links %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-primary " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% else %}
{% for item in random.sample(literal_links, 8) %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-primary " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% endif %}
</div>

</section>

<section class="section">
<h2 class="subtitle"> <span class="tag is-danger is-medium">{{ no_definition_topic|length }} </span> EDAM topics with no definition. </h2>
<h2 class="subtitle"> <span class="tag is-primary is-medium">{{ formatting|length }} </span> Formatting </h2>
EDAM concepts that could use some proper formatting: labels and definitions starting with capital letters, definitions ending with a full stop, and no additional spaces at the beginning or end of any field.
<div class="buttons">
{% if no_definition_topic|length < 8 %}
{% for item in no_definition_topic %}
<a href="{{ item.class }}" class="button is-outlined is-danger " target="_blank" >{{ item.term }}</a>
{% if formatting|length < 8 %}
{% for item in formatting %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-primary " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% else %}
{% for item in random.sample(no_broad_synonym_topic, 8) %}
<a href="{{ item.class }}" class="button is-outlined is-danger " target="_blank" >{{ item.term }}</a>
{% for item in random.sample(formatting, 8) %}
<a href="https://edamontology.github.io/edam-browser/edit.html?term={{ item.class }}&branch=edam" class="button is-outlined is-primary " target="_blank" >{{ item.term }}</a>
{% endfor %}
{% endif %}
</div>
</section>


{# <h2 class="subtitle"> <span class="tag">17 </span> EDAM topics with no synonyms. </h2>
<div class="buttons">
<a href="{{ url_for('quick_curation') }}" class="button" target="_blank" style="border-color:forestgreen;color:forestgreen;background-color: #BBFFCC">Topic A</a>
<a href="{{ url_for('quick_curation') }}" class="button" target="_blank" style="border-color:forestgreen;color:forestgreen;background-color: #BBFFCC">Topic B</a>
<a href="{{ url_for('quick_curation') }}" class="button" target="_blank" style="border-color:forestgreen;color:forestgreen;background-color: #BBFFCC">Topic C</a>
</div>

<h2 class="subtitle"> <span class="tag">123 </span> EDAM operations with missing input attribute(s). </h2>
<div class="content">
<a href="{{ url_for('quick_curation') }}" class="button" target="_blank" style="border-color:indianred;color:indianred;background-color: #FFCCDD">Operation X</a>
<a href="{{ url_for('quick_curation') }}" class="button" target="_blank" style="border-color:indianred;color:indianred;background-color: #FFCCDD">Operation Y</a>
<a href="{{ url_for('quick_curation') }}" class="button" target="_blank" style="border-color:indianred;color:indianred;background-color: #FFCCDD">Operation Z</a>

</div>#}



{% endblock %}

0 comments on commit 7025317

Please sign in to comment.