-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List retracted articles on the author page, if
- Loading branch information
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ASK { | ||
?work wdt:P50 wd:{{q}} . BIND("author-retractions" AS ?aspectsubpage) | ||
{ ?work wdt:P31 wd:Q45182324 } UNION { ?work wdt:P793 wd:Q7316896 . } UNION { ?work wdt:P5824 [] . } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
scholia/app/templates/author_list-of-retracted-articles.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#defaultView:Table | ||
PREFIX target: <http://www.wikidata.org/entity/{{ q }}> | ||
|
||
SELECT | ||
(MIN(?dates) AS ?date) | ||
?work ?workLabel | ||
(GROUP_CONCAT(DISTINCT ?type_label; separator=", ") AS ?type) | ||
(SAMPLE(?pages_) AS ?pages) | ||
?venue ?venueLabel | ||
(GROUP_CONCAT(DISTINCT ?author_label; separator=", ") AS ?authors) | ||
(CONCAT("../authors/", GROUP_CONCAT(DISTINCT SUBSTR(STR(?author), 32); separator=",")) AS ?authorsUrl) | ||
WHERE { | ||
?work wdt:P50 target: . | ||
?work wdt:P50 ?author . | ||
{ ?work wdt:P31 wd:Q45182324 } UNION { ?work wdt:P793 wd:Q7316896 . } UNION { ?work wdt:P5824 [] . } | ||
OPTIONAL { | ||
?author rdfs:label ?author_label_ . FILTER (LANG(?author_label_) = 'en') | ||
} | ||
BIND(COALESCE(?author_label_, SUBSTR(STR(?author), 32)) AS ?author_label) | ||
OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = 'en') } | ||
?work wdt:P577 ?datetimes . | ||
BIND(xsd:date(?datetimes) AS ?dates) | ||
OPTIONAL { ?work wdt:P1104 ?pages_ } | ||
OPTIONAL { ?work wdt:P1433 ?venue } | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } | ||
} | ||
GROUP BY ?work ?workLabel ?venue ?venueLabel | ||
ORDER BY DESC(?date) |
49 changes: 49 additions & 0 deletions
49
scholia/app/templates/author_retracted-articles-per-year.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#defaultView:BarChart | ||
PREFIX target: <http://www.wikidata.org/entity/{{ q }}> | ||
|
||
# Inspired from LEGOLAS - http://abel.lis.illinois.edu/legolas/ | ||
# Shubhanshu Mishra, Vetle Torvik | ||
select ?year (count(?work) as ?number_of_publications) ?role where { | ||
{ | ||
select (str(?year_) as ?year) (0 as ?pages) ("_" as ?role) where { | ||
# default values = 0 | ||
?year_item wdt:P31 wd:Q577 . | ||
?year_item wdt:P585 ?date . | ||
bind(year(?date) as ?year_) | ||
{ | ||
select (min(?year_) as ?earliest_year) (max(?year_) as ?latest_year) where { | ||
?work wdt:P50 target: . | ||
?work wdt:P577 ?publication_date . | ||
{ ?work wdt:P31 wd:Q45182324 } UNION { ?work wdt:P793 wd:Q7316896 . } UNION { ?work wdt:P5824 [] . } | ||
bind(year(?publication_date) as ?year_) | ||
} | ||
} | ||
bind(year(now())+1 as ?next_year) | ||
filter (?year_ >= ?earliest_year && ?year_ <= ?latest_year) | ||
} | ||
} | ||
union { | ||
{ | ||
select ?work (min(?years) as ?year) (count(?coauthors) as ?number_of_authors) ?author_number where { | ||
?work (p:P50|p:P2093) ?author_statement . | ||
?author_statement ps:P50 target: . | ||
optional { ?author_statement pq:P1545 ?author_number . } | ||
?work (wdt:P50|wdt:P2093) ?coauthors . | ||
?work wdt:P577 ?dates . | ||
{ ?work wdt:P31 wd:Q45182324 } UNION { ?work wdt:P793 wd:Q7316896 . } UNION { ?work wdt:P5824 [] . } | ||
bind(str(year(?dates)) as ?years) . | ||
} | ||
group by ?work ?author_number | ||
} | ||
bind(coalesce(if(?number_of_authors = 1, | ||
'Solo author', | ||
if(xsd:integer(?author_number) = 1, | ||
'First author', | ||
if(xsd:integer(?author_number) = ?number_of_authors, | ||
'Last author', | ||
'Middle author'))), 'Unknown') | ||
as ?role) | ||
} | ||
} | ||
group by ?year ?role | ||
order by ?year |