Socket
Socket
Sign inDemoInstall

oni-indexer

Package Overview
Dependencies
138
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    oni-indexer

Builds a Solr index for an oni data repository


Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

JSON LD Solr Indexer


NOTES:

  • Currently spec'd to work only with Datacrate JSON-LD.

TODO:

  • build schema of solr with config file
  • Generalise to use any json-ld
  • Make createROCrateIndexer as part of the library
  • Test with other types of json-ld's

Example implementation:

Generate JSON-LDs

node generate-datacrates.js -d ./test-data/generated/ -n 100

or

npm run generate

Commit to SOLR

Modify config.json to suit your needs.

Use

node ./commit-to-solr.js --config ./config.json

or

npm run commit

Detail

const fieldConfig = require('./fields.json');
let indexer = new ROCrateIndexer();
indexer.setConfig(fieldConfig);

const entryPath = path.join('test-data','CATALOG.json');
let entryJson = fs.readFileSync(entryPath).toString();
entryJson = JSON.parse(entryJson);

const solrObject = await indexer.createSolrObject(entryJson, '@graph');

Keywords

FAQs

Last updated on 25 Mar 2021

Did you know?

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc