diff --git a/src/webapp/app.py b/src/webapp/app.py index 17d731e..ac86123 100644 --- a/src/webapp/app.py +++ b/src/webapp/app.py @@ -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 @@ -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" diff --git a/src/webapp/templates/field_specific.html b/src/webapp/templates/field_specific.html index 65cf858..dde0e07 100644 --- a/src/webapp/templates/field_specific.html +++ b/src/webapp/templates/field_specific.html @@ -1,4 +1,4 @@ -eee{% extends "layout.html" %} +{% extends "layout.html" %} {% block nav %} {% include 'nav.html' %} @@ -9,10 +9,10 @@

Field specific contributions

-

{{ no_regex_identifier|length }} EDAM hybrid identifiers with missing regex.

+

{{ no_regex_identifier|length }} EDAM hybrid identifiers with missing regex.

{% for item in random.sample(no_regex_identifier, 8) %} - {{ item.term }} + {{ item.term }} {% endfor %}
diff --git a/src/webapp/templates/high_priority.html b/src/webapp/templates/high_priority.html index b6e6b40..802d938 100644 --- a/src/webapp/templates/high_priority.html +++ b/src/webapp/templates/high_priority.html @@ -7,16 +7,32 @@ {% block body %}

High priority

+ +
+

{{ mandatory_property_missing|length }} Concepts with missing mandatory properties.

+
+ {% if mandatory_property_missing|length < 8 %} + {% for item in mandatory_property_missing %} + {{ item.term }} + {% endfor %} + {% else %} + {% for item in random.sample(mandatory_property_missing, 8) %} + {{ item.term }} + {% endfor %} + {% endif %} +
+
+
-

{{ no_definition_topic|length }} EDAM topics with no definition.

+

{{ mandatory_property_missing|length }} ID numbers that are no unique.

- {% if no_definition_topic|length < 8 %} - {% for item in no_definition_topic %} - {{ item.term }} + {% if id_unique|length < 8 %} + {% for item in id_unique %} + {{ item.term }} {% endfor %} {% else %} - {% for item in random.sample(no_broad_synonym_topic, 8) %} - {{ item.term }} + {% for item in random.sample(id_unique, 8) %} + {{ item.term }} {% endfor %} {% endif %}
diff --git a/src/webapp/templates/nav.html b/src/webapp/templates/nav.html index 01adcce..32eca10 100644 --- a/src/webapp/templates/nav.html +++ b/src/webapp/templates/nav.html @@ -1,6 +1,7 @@
{% endblock %} \ No newline at end of file diff --git a/src/webapp/templates/quick_curation.html b/src/webapp/templates/quick_curation.html index 23dc820..fa65aa8 100644 --- a/src/webapp/templates/quick_curation.html +++ b/src/webapp/templates/quick_curation.html @@ -11,69 +11,52 @@

Quick and easy tasks

.

-

{{ no_wikipedia_link_topic|length }} EDAM topics with missing wikipedia +

{{ no_wikipedia_link_topic|length }} EDAM topics with missing wikipedia links.

- {% for item in random.sample(no_wikipedia_link_operation, 8) %} -{# {% for item in no_wikipedia_link_topic %}#} - {{ item.term }} - {% endfor %} + {% if no_wikipedia_link_topic|length < 8 %} + {% for item in no_wikipedia_link_topic %} + {{ item.term }} + {% endfor %} + {% else %} + {% for item in random.sample(no_wikipedia_link_topic, 8) %} + {{ item.term }} + {% endfor %} + {% endif %}
-
-

{{ no_wikipedia_link_operation|length }} EDAM operations with missing wikipedia - links.

-
- {% for item in random.sample(no_wikipedia_link_operation, 8) %} -{# {% for item in no_wikipedia_link_operation %}#} - {{ item.term }} - {% endfor %} -
- -
-

{{ no_broad_synonym_topic|length }} EDAM topics with no broad synonyms.

+

{{ literal_links|length }} EDAM concepts have webpage and/or DOI not declared as literal links

- {% for item in random.sample(no_broad_synonym_topic, 8) %} -{# {% for item in no_wikipedia_link_operation %}#} - {{ item.term }} - {% endfor %} + {% if literal_links|length < 8 %} + {% for item in literal_links %} + {{ item.term }} + {% endfor %} + {% else %} + {% for item in random.sample(literal_links, 8) %} + {{ item.term }} + {% endfor %} + {% endif %}
+
-

{{ no_definition_topic|length }} EDAM topics with no definition.

+

{{ formatting|length }} Formatting

+ 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.
- {% if no_definition_topic|length < 8 %} - {% for item in no_definition_topic %} - {{ item.term }} + {% if formatting|length < 8 %} + {% for item in formatting %} + {{ item.term }} {% endfor %} {% else %} - {% for item in random.sample(no_broad_synonym_topic, 8) %} - {{ item.term }} + {% for item in random.sample(formatting, 8) %} + {{ item.term }} {% endfor %} {% endif %}
- -{#

17 EDAM topics with no synonyms.

-
- Topic A - Topic B - Topic C -
- -

123 EDAM operations with missing input attribute(s).

-
- Operation X - Operation Y - Operation Z - -
#} - - - {% endblock %} \ No newline at end of file