Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
TEST 4
by
SR5
This query is marked as a draft
This query has been published
by
SR5
.
Toggle Highlighting
SQL
# pip install sparqlwrapper # https://rdflib.github.io/sparqlwrapper/ from SPARQLWrapper import SPARQLWrapper, JSON endpoint_url = "https://query.wikidata.org/sparql" query = """SELECT DISTINCT ?item ?label ?sitelink WHERE { ?article schema:about ?item; schema:isPartOf <https://ar.wikipedia.org/>; schema:name ?sitelink. ?item rdfs:label ?label. FILTER((LANG(?label)) = "ar") FILTER(?sitelink != ?label) } LIMIT 444""" def get_results(endpoint_url, query): sparql = SPARQLWrapper(endpoint_url) sparql.setQuery(query) sparql.setReturnFormat(JSON) return sparql.query().convert() results = get_results(endpoint_url, query) for result in results["results"]["bindings"]: print(result)
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...