Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Externalize remaining sparql queries in iframes #1284 #1517

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
40516a1
externalize sparql query for chemical_index
curibe Jul 7, 2021
3da2901
externalize sparql query for venues
curibe Jul 7, 2021
a19a169
externalize sparql queries for works
curibe Jul 7, 2021
55787fc
externalize sparql queries for chemical-index-curation
curibe Jul 7, 2021
1939709
externalize sparql query for work_empty
curibe Jul 7, 2021
fce044c
fix: delete commented lines for work_empty
curibe Jul 8, 2021
7ebab60
fix: add link prefixes deleted previously
curibe Jul 8, 2021
90443e2
externalize sparql query for work_cito
curibe Jul 8, 2021
b009ace
externalize sparql queries for author-index-curation
curibe Jul 8, 2021
0292de8
externalize sparql queries for authors
curibe Jul 8, 2021
bafd392
externalize sparql queries for award_curation
curibe Jul 8, 2021
4cbdcb5
externalize sparql queries for pathway_empty
curibe Jul 8, 2021
f21863d
externalize sparql query for property
curibe Jul 8, 2021
1611955
externalize sparql query for software_empty
curibe Jul 8, 2021
c5d4b6f
fix: set the right 'aspect' name for 'chemical-index-curation'
curibe Jul 9, 2021
553e96d
fix: set the right 'aspect' name for 'chemical-index'
curibe Jul 9, 2021
53c0bec
fix: set the right 'aspect' name and other fix for 'author-index-cura…
curibe Jul 9, 2021
409fc23
fix: set the right 'aspect' name for 'award_curation'
curibe Jul 9, 2021
da83bf6
fix: fix id header position for 'author-index-curation'
curibe Jul 9, 2021
0765c1a
externalize sparql queries for topic_curation
curibe Jul 9, 2021
b5608c1
externalize sparql queries for venue_curation
curibe Jul 9, 2021
9210deb
externalize sparql queries for 'use'
curibe Jul 9, 2021
5948de7
fix: set the right 'aspect' name for 'work_cito'
curibe Jul 9, 2021
d74a7ec
fix: change 'empty' by 'index' in aspect for several files
curibe Jul 12, 2021
4b23dff
externalize sparql query for use_empty
curibe Jul 12, 2021
38869a4
externalize sparql query for lexeme_empty
curibe Jul 12, 2021
623d296
feat: externalize query for matrix d3 plot in author
curibe Jul 13, 2021
6ad2b64
feat: externalize query for optional pathway viewer in pathway
curibe Jul 14, 2021
ded489f
feat: externalize query for related in 404_chemical
curibe Jul 14, 2021
5679bbb
fix: change author-index-curation to author-curation
curibe Jul 28, 2021
4317ed1
fix: remove sparql file caption for pathway-viewer diagram
curibe Jul 28, 2021
60db454
externalize iframe sparql for authors
curibe Jul 15, 2021
33c0622
externalize iframe sparql for award_empty
curibe Jul 16, 2021
c2281f4
externalize iframe sparql for property
curibe Jul 16, 2021
afec501
externalize iframe sparql for use
curibe Jul 16, 2021
a3de80f
externalize iframe sparql for venues
curibe Jul 16, 2021
12bd46c
externalize iframe sparql for work_cito
curibe Jul 16, 2021
5477bdb
externalize iframe sparql for works
curibe Jul 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
externalize sparql query for work_cito
  • Loading branch information
curibe committed Jul 28, 2021
commit 90443e29bfe665b39d7837e2f0dcc33ecc76b9a1
33 changes: 9 additions & 24 deletions scholia/app/templates/work_cito.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
{% extends "base.html" %}

{% set aspect = "work_cito" %}

{% block scripts %}
{{super()}}

<script type="text/javascript">
citoIncomingSparql = `
SELECT ?intention ?intentionLabel (COUNT(DISTINCT ?citingArticle) AS ?count) WHERE {
VALUES ?CITEDARTICLE { wd:{{ q }} }
?citingArticle p:P2860 ?citationStatement .
?citationStatement pq:P3712 ?intention ;
ps:P2860 ?CITEDARTICLE .
?intention wdt:P31 wd:Q96471816 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?intention ?intentionLabel
ORDER BY DESC(?count)`

$(document).ready(function() {
sparqlToDataTable(citoIncomingSparql, "#cito-incoming", {
linkPrefixes: {
intention: "../../cito/",
}
});
});
</script>
{% block in_ready %}

{{ sparql_to_table('cito-incoming',
options={
"linkPrefixes": {
"intention": "../../cito/",
}})}}

{% endblock %}

Expand All @@ -36,7 +21,7 @@ <h2>Reasons why this article is cited</h2>
<iframe class="embed-responsive-item" src="https://query.wikidata.org/embed.html#%23defaultView%3ABubbleChart%0ASELECT%20%3Fintention%20%3FintentionLabel%20%28COUNT%28DISTINCT%20%3FcitingArticle%29%20AS%20%3Fcount%29%20WHERE%20%7B%0A%20%20VALUES%20%3FCITEDARTICLE%20%7B%20wd%3A{{q}}%20%7D%0A%20%20%3FcitingArticle%20p%3AP2860%20%3FcitationStatement%20.%0A%20%20%3FcitationStatement%20pq%3AP3712%20%3Fintention%20%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ps%3AP2860%20%3FCITEDARTICLE%20.%0A%20%20%3Fintention%20wdt%3AP31%20wd%3AQ96471816%20.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D%20GROUP%20BY%20%3Fintention%20%3FintentionLabel%0A%20%20ORDER%20BY%20DESC%28%3Fcount%29"></iframe>
</div>

<table class="table table-hover" id="cito-incoming"></table>
<table class="table table-hover" id="cito-incoming-table"></table>

{% endblock %}

9 changes: 9 additions & 0 deletions scholia/app/templates/work_cito_cito-incoming.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SELECT ?intention ?intentionLabel (COUNT(DISTINCT ?citingArticle) AS ?count) WHERE {
VALUES ?CITEDARTICLE { wd:{{ q }} }
?citingArticle p:P2860 ?citationStatement .
?citationStatement pq:P3712 ?intention ;
ps:P2860 ?CITEDARTICLE .
?intention wdt:P31 wd:Q96471816 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?intention ?intentionLabel
ORDER BY DESC(?count)