New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@treecg/basic-bucketizer

Package Overview
Dependencies
Maintainers
9
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@treecg/basic-bucketizer

Applies a basic, linear fragmentation to LDES members

latest
Source
npmnpm
Version
2.1.10
Version published
Weekly downloads
32
220%
Maintainers
9
Weekly downloads
 
Created
Source

Basic Bucketizer

npm

The purpose of the basic bucketizer is to fragment TREE members based on the order they were received. This bucketizer must be used as a fallback bucketizer in case when no fragmentation strategy was chosen.

An LDES bucketizer adds triples with the ldes bucket predicate (https://w3id.org/ldes#bucket) to the array of quads representating an LDES member, indicating the bucket in which the member belongs.

This strategy will create a file called 0.ttl where the first LDES member will be added to, once the page limit is received, a new file, 1.ttl, is created to add LDES members to.

Install

> npm i @treecg/basic-bucketizer

Usage

import { BasicBucketizer } from '@treecg/basic-bucketizer'

const run = async (): Promise<void> => {
  const options = {...};
  const url = ...;
  const pageSize = 50;

  const bucketizer = await BasicBucketizer.build({pageSize: pageSize});

  const ldes = LDESClient.createReadStream(url, options);
  ldes.on('data', (member) => {
    bucketizer.bucketize(member.quads, member.id)

    // Continue processing the member, but now the array of quads will have an extra triple, the bucket triple
  });
}

run().catch(error => console.error(error.stack));

FAQs

Package last updated on 30 Oct 2023

Did you know?

Socket

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