@valueflows/track-trace
v0.1.2
Published
tracking and tracking algorithms working on ValueFlows datasets
Downloads
6
Keywords
Readme
@valueflows/track-trace
Implementation of track & trace algoritms in TypeScript.
- it provides async iterators interface which one can use together with
for - await - of
- it requires data providing RDFJS Source interface
Usage
yarn add @valueflows/track-trace
import { track, trace } from '@valueflows/track-trace'
import data from './store'
const entityInData = 'https://some.example/fbb63f10-ae72-4471-b1d2-a1931208932e'
;(async () => {
for await (const node of track(data, entityInData)) console.log(node)
for await (const node of trace(data, entityInData)) console.log(node)
})
ResultNode
Iterator iterates over results nodes described by this interface:
interface ResultNode {
type :NamedNode,
iri :string,
distance :number
}