GithubHelp home page GithubHelp logo

tpluscode / rdf-dataset-ext Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rdf-ext-archive/rdf-dataset-ext

0.0 1.0 0.0 13 KB

Util functions for easier RDF/JS DatasetCore handling

JavaScript 100.00%

rdf-dataset-ext's Introduction

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.

rdf-dataset-ext's People

Contributors

bergos avatar tpluscode avatar

Watchers

James Cloos 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.