Home Articles Books Search About
日本語
Wikidata Query Service: Exploring Knowledge Graphs with SPARQL

Wikidata Query Service: Exploring Knowledge Graphs with SPARQL

Introduction In Digital Humanities research, structured data is an extremely valuable resource. When information about people, places, works, and events is organized in a machine-readable format, large-scale data analysis and cross-dataset integration become possible. Wikidata is a free knowledge base operated by the Wikimedia Foundation, containing over 100 million items. The Wikidata Query Service is a free web service that allows you to execute SPARQL queries against this database and visualize results in various formats. ...

Retrieving RDF from URIs Using Content Negotiation in Python

Retrieving RDF from URIs Using Content Negotiation in Python

Overview I had an opportunity to retrieve RDF data from Wikidata entity URIs, so here are my notes. Without Content Negotiation First, make a request with empty headers as follows. import requests # URL for the Wikidata entity in RDF format url = "http://www.wikidata.org/entity/Q12418" headers = { } # Sending a GET request to the URL response = requests.get(url, headers=headers) # Checking if the request was successful if response.status_code == 200: text = response.text print(text[:5000]) else: print("Failed to retrieve RDF data. Status code:", response.status_code) In this case, you can retrieve text data in JSON format as follows. ...

Trying Parts of https://wikidata.reconci.link/

Trying Parts of https://wikidata.reconci.link/

Overview During my research, I learned about the existence of the following API. https://wikidata.reconci.link/ This is a memo on how to use it. Suggest Suggest values could be obtained using URLs like the following. https://wikidata.reconci.link/en/suggest/entity?prefix=中村覚 Preview Preview results could be obtained using URLs like the following. https://wikidata.reconci.link/en/preview?id=Q107095935 Summary It appears to be commonly used together with OpenRefine, and I would like to investigate further when the opportunity arises. https://qiita.com/yayamamo/items/eade3e5788e6f359bce7

Trying cwrc's wikidata-entity-lookup

Trying cwrc's wikidata-entity-lookup

Overview This is a continuation of the following article. One of the features of LEAF-WRITER is described as follows: the ability to look up and select identifiers for named entity tags (persons, organizations, places, or titles) from the following Linked Open Data authorities: DBPedia, Geonames, Getty, LGPN, VIAF, and Wikidata. This feature uses libraries such as the following. https://github.com/cwrc/wikidata-entity-lookup I tried out this feature. Usage npm packages are published at the following locations. ...

Trying QuickStatements on wikibase.cloud

Trying QuickStatements on wikibase.cloud

Overview I tried QuickStatements on wikibase.cloud, so here are my notes. I referred to the following article. https://qiita.com/higa4/items/10affb47215def42d8e0 Adding Data Following the article above, I imported a CSV file. However, the following error occurred. The cause was that the required properties were not registered on the independently set up wikibase instance. Property [[Property:P1814|P1814]] not found It turned out that properties (especially those with the same IDs as wikidata) need to be registered in advance using WikibaseSync or similar tools. ...

Trying Out WikibaseSync

Trying Out WikibaseSync

Overview I had the opportunity to try out the following WikibaseSync, so this is a personal note for future reference. https://github.com/the-qa-company/WikibaseSync I learned about this tool from the following paper. https://doi.org/10.11517/jsaisigtwo.2022.SWO-056_04 Installation Install the source code and related libraries. !get clone https://github.com/the-qa-company/WikibaseSync cd WikibaseSync !pip install -r requirements.txt Creating a Bot Account Access the Wikibase prepared in advance, and click “Bot passwords” from “Special pages”. On the following screen, enter the “Bot name”. ...

Retrieving Birth and Death Years of Historical Figures from Wikidata

Retrieving Birth and Death Years of Historical Figures from Wikidata

I created a notebook for retrieving birth and death years of historical figures from Wikidata. I hope this serves as a helpful reference. https://colab.research.google.com/github/nakamura196/ndl_ocr/blob/main/Wikidataから人物の生没年を取得する.ipynb