Skip to content

Commit 09f5c5e

Browse files
committed
Added a data table with basic info, modelled after the one from /work/
1 parent 1345a1f commit 09f5c5e

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

scholia/app/templates/retraction.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
{% block in_ready %}
77

8+
{{ sparql_to_table_post('data') }}
9+
810
{{ sparql_to_table('list-of-authors') }}
911
{{ sparql_to_iframe('citations-per-year') }}
1012
{{ sparql_to_table('statements-with-retracted-references') }}
@@ -17,6 +19,8 @@
1719

1820
<h1 id="h1">Retraction</h1>
1921

22+
<table class="table table-hover" id="data-table"></table>
23+
2024
<h2 id="list-of-authors">List of authors</h2>
2125

2226
<table class="table table-hover" id="list-of-authors-table"></table>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
PREFIX target: <http://www.wikidata.org/entity/{{ q }}>
2+
3+
SELECT DISTINCT ?description ?value ?valueUrl
4+
WHERE {
5+
BIND(target: AS ?work)
6+
{
7+
BIND(1 AS ?order)
8+
BIND("Title" AS ?description)
9+
?work wdt:P1476 ?value .
10+
}
11+
UNION
12+
{
13+
SELECT
14+
(2 AS ?order)
15+
("Reviewers" AS ?description)
16+
(GROUP_CONCAT(?value_; separator=", ") AS ?value)
17+
(CONCAT("../authors/", GROUP_CONCAT(?q; separator=",")) AS ?valueUrl)
18+
{
19+
BIND(1 AS ?dummy)
20+
target: wdt:P4032 ?iri .
21+
BIND(SUBSTR(STR(?iri), 32) AS ?q)
22+
?iri rdfs:label ?value_string .
23+
FILTER (LANG(?value_string) = 'en')
24+
BIND(COALESCE(?value_string, ?q) AS ?value_)
25+
}
26+
GROUP BY ?dummy
27+
}
28+
UNION
29+
{
30+
BIND(3 AS ?order)
31+
BIND("Published in" AS ?description)
32+
?work wdt:P1433 ?iri .
33+
BIND(SUBSTR(STR(?iri), 32) AS ?q)
34+
?iri rdfs:label ?value_string .
35+
FILTER (LANG(?value_string) = 'en')
36+
BIND(COALESCE(?value_string, ?q) AS ?value)
37+
BIND(CONCAT("../venue/", ?q) AS ?valueUrl)
38+
}
39+
UNION
40+
{
41+
BIND(4 AS ?order)
42+
BIND("Publication date" AS ?description)
43+
?work p:P577 / psv:P577 ?publication_date_value .
44+
?publication_date_value wikibase:timePrecision ?time_precision ;
45+
wikibase:timeValue ?publication_date .
46+
BIND(IF(?time_precision = 9, YEAR(?publication_date), xsd:date(?publication_date)) AS ?value)
47+
}
48+
UNION
49+
{
50+
BIND(5 AS ?order)
51+
BIND("Retraction date" AS ?description)
52+
?work p:P31 ?isRetractedPaperStatement .
53+
?isRetractedPaperStatement ps:P31 wd:Q45182324 .
54+
?isRetractedPaperStatement pq:P580 ?retraction_date_value .
55+
BIND(xsd:date(?retraction_date_value) AS ?value)
56+
}
57+
UNION
58+
{
59+
BIND(6 AS ?order)
60+
BIND("Publisher" AS ?description)
61+
?work wdt:P123 ?iri .
62+
BIND(SUBSTR(STR(?iri), 32) AS ?q)
63+
?iri rdfs:label ?value_string .
64+
FILTER (LANG(?value_string) = 'en')
65+
BIND(COALESCE(?value_string, ?q) AS ?value)
66+
BIND(CONCAT("../publisher/", ?q) AS ?valueUrl)
67+
}
68+
UNION
69+
{
70+
BIND(7 AS ?order)
71+
BIND("DOI" AS ?description)
72+
?work wdt:P356 ?valueUrl_ .
73+
BIND(CONCAT("https://doi.org/", ENCODE_FOR_URI(?valueUrl_)) AS ?valueUrl)
74+
BIND(CONCAT(?valueUrl_, "") AS ?value)
75+
}
76+
UNION
77+
{
78+
BIND(8 AS ?order)
79+
BIND("🛑 Retracted by" AS ?description)
80+
?work wdt:P5824 ?iri .
81+
BIND(SUBSTR(STR(?iri), 32) AS ?q)
82+
?iri rdfs:label ?value_string .
83+
FILTER (LANG(?value_string) = 'en')
84+
BIND(COALESCE(?value_string, ?q) AS ?value)
85+
BIND(CONCAT("../work/", ?q) AS ?valueUrl)
86+
}
87+
UNION
88+
{
89+
BIND(9 AS ?order)
90+
BIND("⚠️ Cites retracted article" AS ?description)
91+
{ ?work wdt:P2860 ?retracted . ?retracted wdt:P31 wd:Q45182324 . }
92+
UNION
93+
{ ?work wdt:P2860 ?retracted . ?retracted wdt:P793 wd:Q7316896 . }
94+
UNION
95+
{ ?work wdt:P2860 ?retracted . ?retracted wdt:P5824 [] . }
96+
?retracted rdfs:label ?value_string .
97+
FILTER (LANG(?value_string) = 'en')
98+
BIND(SUBSTR(STR(?retracted), 32) AS ?q)
99+
BIND(COALESCE(?value_string, ?q) AS ?value)
100+
BIND(CONCAT("../work/", ?q) AS ?valueUrl)
101+
}
102+
}
103+
ORDER BY ?order

0 commit comments

Comments
 (0)