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/publisher_editors.sparql
Publisher aspect: editors
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX target: <http://www.wikidata.org/entity/Q73820>
SELECT
?number_of_editorships
?editor ?editorLabel
?example_venue ?example_venueLabel
WITH {
SELECT
(COUNT(?venue_) AS ?number_of_editorships)
?editor
(SAMPLE(?venue_) AS ?example_venue)
# (GROUP_CONCAT(?journal_label; separator=" // ") AS ?venues)
WHERE {
# Find editors for a work published by publisher
?venue_ wdt:P123 target: .
?venue_ wdt:P98 | wdt:P5769 ?editor .
# ?venue_ rdfs:label ?venue_label . FILTER(LANG(?venue_label) = 'en')
}
GROUP BY ?editor
} AS %result
WHERE {
# Label the result
INCLUDE %result
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . }
}
graph TD