GithubHelp home page GithubHelp logo

cinii-entity-lookup's Introduction

cinii-entity-lookup

Picture

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

  1. Overview
  2. Installation
  3. Use
  4. API
  5. Development

Overview

Finds entities (people, places, organizations, titles) in cinii. 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 cinii-entity-lookup

Use

import ciniiLookup from 'cinii-entity-lookup';

API

findRS(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": "https://cinii.org/cinii/9447148209321300460003/",
  "name": "Fay Jones School of Architecture and Design",
  "nameType": "Corporate",
  "originalQueryString": "jones",
  "repository": "cinii",
  "uri": "https://cinii.org/9447148209321300460003/",
  "uriForDisplay": "https://cinii.org/9447148209321300460003/"
}

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

getRSLookupURI(query)

where the 'query' argument is the entity name to find and the methods return the cinii 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.

cinii-entity-lookup's People

Contributors

nakamura196 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.