Skip to content

Commit

Permalink
Merge pull request #39 from cwrc/development
Browse files Browse the repository at this point in the history
Merge Development to Production
  • Loading branch information
lucaju authored Mar 6, 2020
2 parents 4d3e08a + 703729f commit bc0d8c6
Show file tree
Hide file tree
Showing 7 changed files with 6,178 additions and 7,598 deletions.
22 changes: 22 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jest": true
},
"extends": ["eslint:recommended"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
},
"rules": {
"quotes": [2, "single"],
"require-atomic-updates": "off",
"no-unused-vars": 2
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cache: npm
notifications:
email: false
node_js:
- '9'
- '12.14.0'
before_script:
- npm prune
script:
Expand Down
248 changes: 139 additions & 109 deletions API.md

Large diffs are not rendered by default.

54 changes: 28 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# CWRC-PublicEntityDialogs

![Picture](http://cwrc.ca/logos/CWRC_logos_2016_versions/CWRCLogo-Horz-FullColour.png)

[![Travis](https://img.shields.io/travis/cwrc/CWRC-PublicEntityDialogs.svg)](https://travis-ci.org/cwrc/CWRC-PublicEntityDialogs)
Expand All @@ -9,55 +11,55 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

# CWRC-PublicEntityDialogs

1. [Overview](#overview)
1. [Installation](#installation)
1. [Use](#use)
1. [API](#api)
1. [Development](#development)

### Overview
## Overview

The CWRC-PublicEntityDialogs are used with the [CWRC-WriterBase](https://github.com/cwrc/CWRC-WriterBase) to lookup entities (people, places, organizations, and titles) in various public name authority files (e.g. VIAF) or databases (e.g. Wikidata). The dialogs only provide public lookup. Creation/editing/deletion of entities should be made outside of the CWRC-Writer in the name authority itself.
The CWRC-PublicEntityDialogs are used with the [CWRC-WriterBase](https://github.com/cwrc/CWRC-WriterBase) to lookup entities (people, places, organizations, and titles) in various public name authority files (e.g. VIAF) or databases (e.g. Wikidata). The dialogs only provide public lookup. Creation/editing/deletion of entities should be made outside of the CWRC-Writer in the name authority itself.

The currently available entity lookup sources are:
* [getty-entity-lookup](https://github.com/cwrc/getty-entity-lookup)
* [wikidata-entity-lookup](https://github.com/cwrc/wikidata-entity-lookup)
* [dbpedia-entity-lookup](https://github.com/cwrc/dbpedia-entity-lookup)
* [viaf-entity-lookup](https://github.com/cwrc/viaf-entity-lookup)
* [geonames-entity-lookup](https://github.com/cwrc/geonames-entity-lookup)

### Installation
- [getty-entity-lookup](https://github.com/cwrc/getty-entity-lookup)
- [wikidata-entity-lookup](https://github.com/cwrc/wikidata-entity-lookup)
- [dbpedia-entity-lookup](https://github.com/cwrc/dbpedia-entity-lookup)
- [viaf-entity-lookup](https://github.com/cwrc/viaf-entity-lookup)
- [geonames-entity-lookup](https://github.com/cwrc/geonames-entity-lookup)

```npm install cwrc-public-entity-dialogs```
## Installation

### Use
`npm install cwrc-public-entity-dialogs`

## Use

The dialogs must be configured with entity lookup sources, using the registerEntitySources method. They are then passed to the CWRC-WriterBase.
```
const EntityLookupDialogs = require('cwrc-public-entity-dialogs')

const viaf = require('viaf-entity-lookup')
const dbpedia = require('dbpedia-entity-lookup')
```js
const EntityLookupDialogs = require("cwrc-public-entity-dialogs");

const viaf = require("viaf-entity-lookup");
const dbpedia = require("dbpedia-entity-lookup");

EntityLookupDialogs.registerEntitySources({
person: (new Map()).set('viaf', viaf).set('dbpedia', dbpedia),
place: (new Map()).set('viaf', viaf).set('dbpedia', dbpedia),
organization: (new Map()).set('viaf', viaf).set('dbpedia', dbpedia),
title: (new Map()).set('viaf', viaf).set('dbpedia', dbpedia)
})
person: new Map().set("viaf", viaf).set("dbpedia", dbpedia),
place: new Map().set("viaf", viaf).set("dbpedia", dbpedia),
organization: new Map().set("viaf", viaf).set("dbpedia", dbpedia),
title: new Map().set("viaf", viaf).set("dbpedia", dbpedia)
});

const CWRCWriter = require('cwrc-writer-base')
const CWRCWriter = require("cwrc-writer-base");
const writer = new CWRCWriter({
entityLookupDialogs: EntityLookupDialogs
})
```
});
```

### API
## API

[View the full API here](https://github.com/cwrc/CWRC-PublicEntityDialogs/blob/master/API.md)

### Development
## Development

[CWRC-Writer-Dev-Docs](https://github.com/cwrc/CWRC-Writer-Dev-Docs) explains how to work with CWRC-Writer GitHub repositories, including this one.
Loading

0 comments on commit bc0d8c6

Please sign in to comment.