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. i # u h } # r # i e m r e e f l p U l a S s C s o R d e p h r e r L = e n o e e t p : p t r d n c s e r r f " s i s k p x i i r o h n e i o t n n e r t = g n n t t q t = g s = ( ( u t p { a e t " e h : r i . r e F s e / G e f s e x a t / E q t s t i s W w T u t a p [ l i w e h t o : e k w r s e u n 5 d i . e t s s 0 d w q s r _ e 0 t a i u . e c . 0 o t k e g q o t ] a i s e u d e ) r d t t e e x e e a ( s t t n t t u t = r t a o r = i i . l w e t o t , a 2 v y r h s 0 e g e h 0 i / e s : R n e U a u D n R d c F R t L e c D i r e d F t s s a y = s t f h f a Q e u . r 1 a l m 2 d S a 4 e t t 1 r a 8 s t " ) u s c o d e : " , r e s p o n s e . s t a t u s _ c o d e ) In this case, you can retrieve text data in JSON format as follows. ...

June 23, 2024 · 18 min · Nakamura

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

June 17, 2024 · 1 min · Nakamura

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. ...

May 16, 2024 · 3 min · Nakamura

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. P r o p e r t y [ [ P r o p e r t y : P 1 8 1 4 | P 1 8 1 4 ] ] n o t f o u n d It turned out that properties (especially those with the same IDs as wikidata) need to be registered in advance using WikibaseSync or similar tools. ...

July 19, 2023 · 2 min · Nakamura

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. ! c ! g d p e i t W p i c k i l i n o b s n a t e s a e l h S l t y t n - p c r s : r / e / q g u i i t r h e u m b e . n c t o s m . / t t x h t e - q a - c o m p a n y / W i k i b a s e S y n c Creating a Bot Account Access the Wikibase prepared in advance, and click “Bot passwords” from “Special pages”. ...

July 19, 2023 · 6 min · Nakamura

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

October 27, 2022 · 1 min · Nakamura