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.

I tried out this feature.

Usage

npm packages are published at the following locations.

Although not listed above, the target for this time is the following.

Install it with the following command.

npm i wikidata-entity-lookup

wikidataLookup.findPerson can be executed as follows.

<script lang="ts" setup>
// @ts-ignore
import wikidataLookup from "wikidata-entity-lookup";

interface Entity {
  id: string;
  name: string;
  description: string;
  uri: string;
}

const query = ref<string>("");
const results = ref<Entity[]>([]);

const search = () => {
  wikidataLookup.findPerson(query.value).then((result: Entity[]) => {
    results.value = result;
  });
};
</script>

Demo

I prepared an implementation example with Nuxt.

You can try it at the following URL.

Summary

I hope this serves as a helpful reference.