Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dbpedia-entity-lookup

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbpedia-entity-lookup - npm Package Compare versions

Comparing version 0.0.0-development to 0.0.0

85

package.json

@@ -1,84 +0,1 @@

{
"name": "dbpedia-entity-lookup",
"version": "0.0.0-development",
"description": "Find entities (people, places, organizations, titles) in dbpedia.",
"main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/cwrc/dbpedia-entity-lookup.git"
},
"keywords": [
"dbpedia",
"entity",
"linked-data",
"sparql"
],
"author": "James Chartrand",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/cwrc/dbpedia-entity-lookup/issues"
},
"homepage": "https://github.com/cwrc/dbpedia-entity-lookup#readme",
"scripts": {
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"cm": "git-cz",
"precommit": "npm run test && npm run check-coverage",
"browserify": "mkdirp build && browserify test/development.js -o build/development.js --debug -t [ babelify --presets [ es2015 ] ]",
"watch": "mkdirp build && watchify test/development.js -o build/development.js --debug --verbose -t [ babelify --presets [ es2015 ] ]",
"test": "mkdirp coverage && npm run test:electron && npm run generate-coverage",
"test:browser": "cross-env NODE_ENV=test browserify test/browser.js | browser-run -p 2222 --static . | node test/extract-coverage.js | faucet",
"test:electron": "cross-env NODE_ENV=test browserify test/browser.js | browser-run --static . | node test/extract-coverage.js | faucet ",
"test:chrome": "cross-env NODE_ENV=test browserify test/browser.js | browser-run --static . -b chrome | node test/extract-coverage.js | faucet ",
"generate-coverage": "istanbul report --root coverage lcov",
"check-coverage": "istanbul check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
"report-coverage": "cat ./coverage/lcov.info | codecov"
},
"devDependencies": {
"babel-plugin-istanbul": "4.1.5",
"babel-preset-es2015": "6.24.1",
"babelify": "7.3.0",
"browser-run": "4.0.2",
"browserify": "14.3.0",
"codecov.io": "0.1.6",
"commitizen": "2.9.6",
"concat-stream": "1.6.0",
"cross-env": "5.0.5",
"cz-conventional-changelog": "2.0.0",
"faucet": "0.0.1",
"fetch-mock": "5.12.2",
"husky": "0.13.3",
"istanbul": "0.4.5",
"mkdirp": "0.5.1",
"semantic-release": "6.3.6",
"sinon": "4.0.1",
"tape": "4.6.3",
"tape-promise": "2.0.1",
"watch": "1.0.2",
"watchify": "3.9.0"
},
"config": {
"commitizen": {
"path": "node_modules/cz-conventional-changelog"
}
},
"dependencies": {},
"browserify": {
"transform": [
[
"babelify",
{
"presets": [
"es2015"
],
"env": {
"test": {
"plugins": [
"istanbul"
]
}
}
}
]
]
}
}
{"name":"dbpedia-entity-lookup","version":"0.0.0","description":"Find entities (people, places, organizations, titles) in dbpedia.","main":"src/index.js","repository":{"type":"git","url":"https://github.com/cwrc/dbpedia-entity-lookup.git"},"keywords":["dbpedia","entity","linked-data"],"author":"James Chartrand","license":"GPL-3.0","bugs":{"url":"https://github.com/cwrc/dbpedia-entity-lookup/issues"},"homepage":"https://github.com/cwrc/dbpedia-entity-lookup#readme","scripts":{"semantic-release":"semantic-release pre && npm publish && semantic-release post","cm":"git-cz","precommit":"npm run test && npm run check-coverage","browserify":"mkdirp build && browserify test/development.js -o build/development.js --debug -t [ babelify --presets [ es2015 ] ]","watch":"mkdirp build && watchify test/development.js -o build/development.js --debug --verbose -t [ babelify --presets [ es2015 ] ]","test":"mkdirp coverage && npm run test:electron && npm run generate-coverage","test:browser":"cross-env NODE_ENV=test browserify test/browser.js | browser-run -p 2222 --static . | node test/extract-coverage.js | faucet","test:electron":"cross-env NODE_ENV=test browserify test/browser.js | browser-run --static . | node test/extract-coverage.js | faucet ","test:chrome":"cross-env NODE_ENV=test browserify test/browser.js | browser-run --static . -b chrome | node test/extract-coverage.js | faucet ","generate-coverage":"istanbul report --root coverage lcov","check-coverage":"istanbul check-coverage --statements 100 --branches 100 --functions 100 --lines 100","report-coverage":"cat ./coverage/lcov.info | codecov"},"devDependencies":{"babel-plugin-istanbul":"4.1.5","babel-preset-es2015":"6.24.1","babelify":"7.3.0","browser-run":"4.0.2","browserify":"14.3.0","codecov.io":"0.1.6","commitizen":"2.9.6","concat-stream":"1.6.0","cross-env":"5.0.5","cz-conventional-changelog":"2.0.0","faucet":"0.0.1","fetch-mock":"5.12.2","husky":"0.13.3","istanbul":"0.4.5","mkdirp":"0.5.1","semantic-release":"^8.2.0","sinon":"4.0.1","tape":"4.6.3","tape-promise":"2.0.1","watch":"1.0.2","watchify":"3.9.0"},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"dependencies":{},"browserify":{"transform":[["babelify",{"presets":["es2015"],"env":{"test":{"plugins":["istanbul"]}}}]]}}

16

src/index.js

@@ -14,3 +14,2 @@ 'use strict';

function fetchWithTimeout(url, config = {headers: {'Accept': 'application/json'}}, timeout = 8000) {

@@ -46,5 +45,3 @@

function getEntitySourceURI(queryString, queryClass) {
return `http://lookup.dbpedia.org/api/search/KeywordSearch?QueryClass=${queryClass}&MaxHits=5&QueryString=${encodeURIComponent(queryString)}`
}

@@ -68,5 +65,5 @@

async function callDBPedia(url, queryString, queryClass) {
function callDBPedia(url, queryString, queryClass) {
let parsedJSON = await fetchWithTimeout(url);
return fetchWithTimeout(url).then((parsedJSON)=>{
return parsedJSON.results.map(

@@ -80,17 +77,18 @@ ({

})
})
}
async function findPerson(queryString) {
function findPerson(queryString) {
return callDBPedia(getPersonLookupURI(queryString), queryString, 'person')
}
async function findPlace(queryString) {
function findPlace(queryString) {
return callDBPedia(getPlaceLookupURI(queryString), queryString, 'place')
}
async function findOrganization(queryString) {
function findOrganization(queryString) {
return callDBPedia(getOrganizationLookupURI(queryString), queryString, 'organisation')
}
async function findTitle(queryString) {
function findTitle(queryString) {
return callDBPedia(getTitleLookupURI(queryString), queryString, 'work')

@@ -97,0 +95,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc