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/author_topics-works-matrix.sparql
Author aspect: topics works matrix
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 target: <http://www.wikidata.org/entity/Q97270>
SELECT ?work ?workLabel ?topic ?topicLabel WHERE {
?work wdt:P50 target: .
?work wdt:P921 ?topic .
OPTIONAL { ?work wdt:P577 ?publication_date }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,cz,da,de,es,fr,hi,jp,nl,nn,ru,sv,zh". }
}
ORDER BY ?publication_date
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?publication_date")
v3("?topic"):::projected
v2("?work"):::projected
c6([http://www.bigdata.com/rdf#serviceParam]):::iri
c2([http://www.wikidata.org/entity/Q97270]):::iri
c8(["#91;AUTO_LANGUAGE#93;,mul,en,cz,da,de,es,fr,hi,jp,nl,nn,ru,sv,zh"]):::literal
v2 --"p:direct/P50"--> c2
v2 --"p:direct/P921"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P577".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end