A set of SPARQL examples that are used in different TGX resources
License: https://www.gnu.org/licenses/gpl-3.0
Uses method in: https://github.com/WDscholia/scholia/tree/master/scholia/app/templates/work_cited-works.sparql
Work aspect: cited works
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
#defaultView:Table
PREFIX target: <http://www.wikidata.org/entity/Q28942417>
# List of works that is cited by the specified work
SELECT ?citations ?publication_date ?cited_work ?cited_workLabel
WITH {
SELECT (MIN(?date) AS ?publication_date) (COUNT(DISTINCT ?citing_cited_work) AS ?citations) ?cited_work
WHERE {
target: wdt:P2860 ?cited_work .
OPTIONAL {
?cited_work wdt:P577 ?datetime .
BIND(xsd:date(?datetime) AS ?date)
}
OPTIONAL { ?citing_cited_work wdt:P2860 ?cited_work }
}
GROUP BY ?cited_work
} AS %result
WHERE {
INCLUDE %result
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . }
}
ORDER BY DESC(?citations) DESC(?date)
graph TD