query-fe774b8a83fa1b862145213f3a9c1bfa
Revenue village in tewiki for updating with Infobox India AP Village
SELECT DISTINCT ?village ?page_titleTE WHERE {
hint:Query hint:optimizer "None".
{
?village (wdt:P131) wd:Q1159;
wdt:P131 ?mandal;
(wdt:P31/(wdt:P279)) wd:Q56061;
wdt:P5578 ?2011censuscode.
OPTIONAL { ?village wdt:P18 ?prefimgfilename. }
OPTIONAL {
?village p:P18 ?imgst.
?imgst ps:P18 ?imgfilename;
pq:P2096 ?imglegend.
FILTER((LANG(?imglegend)) = "te")
}
?tewikilink schema:about ?village;
schema:isPartOf https://te.wikipedia.org/;
schema:name ?page_titleTE.
SERVICE wikibase:label { bd:serviceParam wikibase:language "te". }
FILTER((?2011censuscode > "579012") && (?2011censuscode < "597114"))
FILTER(BOUND(?prefimgfilename))
FILTER(!(BOUND(?imglegend)))
} MINUS
{
SELECT ?village WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:endpoint "te.wikipedia.org".
bd:serviceParam mwapi:generator "transcludedin".
bd:serviceParam mwapi:titles "Template:Infobox India AP Village".
?village wikibase:apiOutputItem mwapi:item.
}
} LIMIT 2000
}
}
ORDER BY (?page_titleTE)
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 wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Revenue village in tewiki for updating with Infobox India AP Village
SELECT DISTINCT ?village ?page_titleTE WHERE {
{
?village (wdt:P131*) wd:Q1159;
wdt:P131 ?mandal;
(wdt:P31/(wdt:P279*)) wd:Q56061;
wdt:P5578 ?2011censuscode.
OPTIONAL { ?village wdt:P18 ?prefimgfilename. }
OPTIONAL {
?village p:P18 ?imgst.
?imgst ps:P18 ?imgfilename;
pq:P2096 ?imglegend.
FILTER((LANG(?imglegend)) = "te")
}
?tewikilink schema:about ?village;
schema:isPartOf <https://te.wikipedia.org/>;
schema:name ?page_titleTE.
SERVICE wikibase:label { bd:serviceParam wikibase:language "te". }
FILTER((?2011censuscode > "579012") && (?2011censuscode < "597114"))
FILTER(BOUND(?prefimgfilename))
FILTER(!(BOUND(?imglegend)))
} MINUS
{
SELECT ?village WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:endpoint "te.wikipedia.org".
bd:serviceParam mwapi:generator "transcludedin".
bd:serviceParam mwapi:titles "Template:Infobox India AP Village".
?village wikibase:apiOutputItem mwapi:item.
}
} LIMIT 2000
}
}
ORDER BY (?page_titleTE)