@rdfjs/term-set
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/rdfjs__term-set package

    1.1.0 • Public • Published

    @rdfjs/term-set

    A Set for RDFJS Terms.

    This package implements the JavaScript Set interface exclusively for RDFJS Terms and treats Terms with the same N-Triples representation as they are the same object.

    Usage

    The package exports the constructor of the Term-Set. New instances can be created just like JavaScript Sets:

    const rdf = require('@rdfjs/data-model')
    const TermSet = require('@rdfjs/term-set')
    
    const terms = new TermSet([
      rdf.namedNode('http://example.org/'),
      rdf.literal('test')
    ])
    
    // The rdf factory will return a new instance of the literal,
    // but the Term-Set will check for the N-Triple representation.
    // That's why the output will be: "true"
    console.log(terms.has(rdf.literal('test')))

    Install

    npm i @rdfjs/term-set

    DownloadsWeekly Downloads

    1,651

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    13 kB

    Total Files

    6

    Last publish

    Collaborators

    • bergos
    • l00mi