Architecture of Information Systems Search Engine
John Samuel
CPE Lyon
Year: 2018-2019
Email: john(dot)samuel(at)cpe(dot)fr
SELECT ?item ?location
WHERE {
?item wdt:P1435 wd:Q9259;
wdt:P625 ?location
}
import requests
url = "https://api.github.com/"
response = requests.get(url)
print(response.json())
from SPARQLWrapper import SPARQLWrapper, JSON
sparql = SPARQLWrapper("http://query.wikidata.org/sparql")
sparql.setQuery("""
SELECT ?item WHERE {
?item wdt:P31 wd:Q9143;
}
LIMIT 10
""")
sparql.setReturnFormat(JSON)
results = sparql.query().convert()
for result in results["results"]["bindings"]:
print(result)