Socket
Socket
Sign inDemoInstall

rdf-dataset-ext

Package Overview
Dependencies
7
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

rdf-dataset-ext

Util functions for easier RDF/JS DatasetCore handling


Version published
Maintainers
1
Weekly downloads
1,936
decreased by-22.5%

Weekly downloads

Readme

Source

rdf-dataset-ext

Util functions for easier RDF/JS DatasetCore handling.

Usage

All provided functions can be imported as properties of the package or directly from the file matching the function name.

Import addAll from property:

const { addAll } = require('rdf-dataset-ext')

Import addAll from file:

const addAll = require('rdf-dataset-ext/addAll')

addAll(dataset, iterable)

Iterates over iterable and adds all quads to dataset by calling .add for each quad. Returns the given dataset.

deleteMatch(dataset, subject, predicate, object, graph)

Deletes all quads in the given dataset which match the given subject, predicate, object, graph pattern. .match of dataset is used to find the matches and .delete to delete all matches. Returns the given dataset.

equals(a, b)

Tests if the datasets a and b contain the same quads without doing a normalization step beforehand. That means Blank Node labels must also match. The comparison is done by testing .size of both dataset for equality and by looping over all quads of a and check if b contains it using the .has method. Returns true if both datasets are equal. Otherwise false is returned.

async fromStream(dataset, stream)

Adds all quads from stream till the stream is finished. Errors emitted by the stream are forwarded as Promise rejects. Returns the given dataset.

toCanonical(dataset)

Returns the canonical representation of the dataset as string.

toStream(dataset)

Creates a Stream which emits all quads of the given dataset. Returns the created stream.

Keywords

FAQs

Last updated on 16 Feb 2022

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