query-089d730dc25a70a3af1baff286504533
need help with a query. I come up with : c:Category:Commons_licensing_help_by_countryI am trying to get a query with properties of items that have sitelings pointing to pages on
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?instanceLabel ?countryLabel ?jurisdictionLabel ?subjectLabel {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam mwapi:gcmtitle "Category:Commons_licensing_help_by_country" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "page" .
bd:serviceParam mwapi:gcmlimit "max" .
bd:serviceParam mwapi:gcmsort "timestamp" .
bd:serviceParam mwapi:gcmdir "descending" .
?item wikibase:apiOutput mwapi:title .
}
#?commonsSitelink schema:about ?item; schema:isPartOf <https://commons.wikimedia.org/>; schema:name ?sitelink_label .
Optional { ?item wdt:P31 ?instance. }
Optional { ?item wdt:P17 ?country. }
Optional { ?item wdt:P1001 ?jurisdiction. }
Optional { ?item wdt:P921 ?subject. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?country")
v2("?instance")
v1("?item"):::projected
v4("?jurisdiction")
v5("?subject")
c18(["descending"]):::literal
c2(["bd:serviceParam"]):::iri
c8(["Category:Commons_licensing_help_by_country"]):::literal
c6(["commons.wikimedia.org"]):::literal
c16(["timestamp"]):::literal
c14(["max"]):::literal
c10(["categorymembers"]):::literal
c27(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c12(["page"]):::literal
c20(["mwapi:title"]):::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
c2 --"mwapi:gcmsort"--> c16
c2 --"mwapi:gcmdir"--> c18
v1 --"mwapi:apiOutput"--> c20
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P31".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P17".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1001".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P921".-> v5
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c2 --"mwapi:language"--> c27
end