query-ed1bbd055112511c9ff51b86e815b496
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?file ?title ?P180 ?P180Label ?article ?sitelink
WHERE
{
{
SELECT ?file ?title
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam mwapi:gcmtitle "Category:Finland framstäldt i teckningar" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "file" .
bd:serviceParam mwapi:gcmlimit "max" .
?title wikibase:apiOutput mwapi:title .
?pageid wikibase:apiOutput "@pageid" .
}
BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?file)
}
} OPTIONAL {?file wdt:P180 ?P180 .
OPTIONAL {
SERVICE <https://query.wikidata.org/sparql> {
OPTIONAL {?article schema:about ?P180 ;
schema:isPartOf <https://sv.wikipedia.org/> ;
schema:name ?sitelink .}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?P180 rdfs:label ?P180Label . }
}
}
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?P180"):::projected
v7("?P180Label"):::projected
v5("?article"):::projected
v3("?file"):::projected
v2("?pageid")
v6("?sitelink"):::projected
v1("?title"):::projected
c2(["bd:serviceParam"]):::iri
c12(["file"]):::literal
c8(["Category:Finland framstäldt i teckningar"]):::literal
c6(["commons.wikimedia.org"]):::literal
c17(["@pageid"]):::literal
c14(["max"]):::literal
c10(["categorymembers"]):::literal
c26(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c16(["mwapi:title"]):::iri
c22([https://sv.wikipedia.org/]):::iri
c4(["Generator"]):::literal
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:api"--> c4
c2 --"mwapi:endpoint"--> c6
c2 --"mwapi:gcmtitle"--> c8
c2 --"mwapi:generator"--> c10
c2 --"mwapi:gcmtype"--> c12
c2 --"mwapi:gcmlimit"--> c14
v1 --"mwapi:apiOutput"--> c16
v2 --"mwapi:apiOutput"--> c17
end
bind0[/"concat('https://commons.wikimedia.org/entity/M',?pageid)"/]
v2 --o bind0
bind0 --as--o v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P180".-> v4
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
subgraph s2["https://query.wikidata.org/sparql"]
style s2 stroke-width:4px;
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."schema:about".-> v4
v5 --"schema:isPartOf"--> c22
v5 --"schema:name"--> v6
end
subgraph s3["http://wikiba.se/ontology#label"]
style s3 stroke-width:4px;
c2 --"mwapi:language"--> c26
v4 --"rdfs:label"--> v7
end
end
end
end