We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use keywords and structure from wikidata?
The text was updated successfully, but these errors were encountered:
Example code with SPARQL:
#!/usr/bin/env python3 from SPARQLWrapper import SPARQLWrapper, JSON import pandas as pd sparql = SPARQLWrapper("https://query.wikidata.org/sparql") sparql.setQuery(""" SELECT ?item ?itemLabel WHERE { ?item wdt:P279 wd:Q522171. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } """) sparql.setReturnFormat(JSON) results = sparql.query().convert() results_df = pd.json_normalize(results['results']['bindings']) print(results_df[['item.value', 'itemLabel.value']])
Sorry, something went wrong.
SPARQL did not work as expected. Some properties were not received properly in case of long lists. Now using direct request to json entity endpoint: https://www.wikidata.org/wiki/Special:EntityData/Q31.json
json
TODO: Remove keyword and directly replace by wikidata items.
No branches or pull requests
Use keywords and structure from wikidata?
The text was updated successfully, but these errors were encountered: