Skip to content

Commit

Permalink
externalize iframe sparql for work_cito
Browse files Browse the repository at this point in the history
  • Loading branch information
curibe committed Jul 16, 2021
1 parent 18ab720 commit 06d9f61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions scholia/app/templates/work-cito_cito-incoming-chart.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#defaultView:BubbleChart
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)
6 changes: 4 additions & 2 deletions scholia/app/templates/work_cito.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
"intention": "../../cito/",
}})}}

{{ sparql_to_iframe('cito-incoming-chart') }}

{% endblock %}

{% block page_content %}
<h1 id="h1">Work</h1>

<h2>Reasons why this article is cited</h2>
<h2 id="cito-incoming-header">Reasons why this article is cited</h2>

<div class="embed-responsive embed-responsive-16by9">
<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>
<iframe class="embed-responsive-item" id="cito-incoming-chart-iframe"></iframe>
</div>

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

0 comments on commit 06d9f61

Please sign in to comment.