Socket
Book a DemoInstallSign in
Socket

viaf-entity-lookup

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

viaf-entity-lookup

Find entities (people, places, organizations) in VIAF.

latest
Source
npmnpm
Version
2.1.0
Version published
Maintainers
2
Created
Source

viaf-entity-lookup

Picture

Travis Codecov version downloads GPL-2.0 semantic-release Commitizen friendly experimental

Overview

Finds entities (people, places, organizations, titles) in VIAF. Meant to be used with cwrc-public-entity-dialogs where it runs in the browser.

Although it will not work in node.js as-is, it does use the Fetch API for http requests, and so could likely therefore use a browser/node.js compatible fetch implementation like: isomorphic-fetch.

Installation

npm i viaf-entity-lookup -S

Use

import viafLookup from 'viaf-entity-lookup';

API

findPerson(query)

findPlace(query)

findOrganization(query)

findTitle(query)

where the 'query' argument is an object:

{
  entity: "The name of the thing the user wants to find.";
  options: "TBD";
}

and all find methods return promises that resolve to an object like the following:

{
  "id": "http://viaf.org/viaf/9447148209321300460003/",
  "name": "Fay Jones School of Architecture and Design",
  "nameType": "Corporate",
  "originalQueryString": "jones",
  "repository": "VIAF",
  "uri": "http://viaf.org/viaf/9447148209321300460003/",
  "uriForDisplay": "https://viaf.org/viaf/9447148209321300460003/"
}

There are a further four methods that are mainly made available to facilitate testing (to make it easier to mock calls to the VIAF service):

getPersonLookupURI(query)

getPlaceLookupURI(query)

getOrganizationLookupURI(query)

getTitleLookupURI(query)

where the 'query' argument is the entity name to find and the methods return the VIAF URL that in turn returns results for the query.

Development

CWRC-Writer-Dev-Docs describes general development practices for CWRC-Writer GitHub repositories, including this one.

Mocking

We use fetch-mock to mock http calls (which we make using the Fetch API rather than XMLHttpRequest).

Continuous Integration

We use Travis.

Release

We follow SemVer, which Semantic Release makes easy. Semantic Release also writes our commit messages, sets the version number, publishes to NPM, and finally generates a changelog and a release (including a git tag) on GitHub.

Keywords

viaf

FAQs

Package last updated on 02 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts