https://github.com/comunica/rdf-streaming-store.js
A read-only RDF/JS store that allows parallel data lookup and insertion
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords from Contributors
Repository
A read-only RDF/JS store that allows parallel data lookup and insertion
Basic Info
- Host: GitHub
- Owner: comunica
- License: mit
- Language: TypeScript
- Default Branch: master
- Size: 149 KB
Statistics
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 10
- Releases: 0
Metadata Files
README.md
RDF Streaming Store
A read-only RDF/JS store that allows parallel data lookup and insertion. It works in both JavaScript and TypeScript.
Concretely, this means that match() calls happening before import() calls, will still consider those triples that
are inserted later, which is done by keeping the response streams of match() open.
Only when the end() method is invoked, all response streams will close, and the StreamingStore will be considered
immutable.
WARNING: end() MUST be called at some point, otherwise all match streams will remain unended.
If using TypeScript, it is recommended to use this in conjunction with @rdfjs/types.
Installation
bash
$ npm install rdf-streaming-store
or
bash
$ yarn add rdf-streaming-store
This package also works out-of-the-box in browsers via tools such as webpack and browserify.
Usage
A new StreamingStore can be created as follows:
```typescript import { StreamingStore } from 'rdf-streaming-store';
const store = new StreamingStore(); ```
Inserting quads
Following the RDF/JS Sink interface,
new quads can be added using the import method, which accepts a stream of quads:
```typescript const quad = require('rdf-quad'); const streamifyArray = require('streamify-array');
// Somehow create a quad stream const quadStream = streamifyArray([ quad('s3', 'p3', 'o3'), quad('s4', 'p4', 'o4'), ]);
// Import it into the store store.import(quadStream); ```
After inserting your quads, you MUST call end() to make sure that match calls will end their response streams:
typescript
store.end();
After calling end(), importing new quads is not allowed.
Finding quads
Following the RDF/JS Source interface,
quads can be found using the match method, which returns a stream of quads:
```typescript
import type * as RDF from '@rdfjs/types';
import { DataFactory } from 'rdf-data-factory';
const DF = new DataFactory(); const returnStream = store.match(undefined, DF.namedNode('p3'), DF.namedNode('o3'), undefined);
returnStream.on('data', (quad: RDF.Quad) => { console.log(quad); }); returnStream.on('error', (error) => { console.log(error); }); returnStream.on('end', () => { console.log('Done!'); }); ```
Note that the returnStream will not end until the store.end() has been invoked.
match() can be called before import()
Since match() calls will only end after calling end(),
quads that are imported after initiating the match() call,
can still be emitted in the created match() stream.
```typescript const store = new StreamingStore(); const returnStream = store.match(undefined, DF.namedNode('p3'), DF.namedNode('o3'), undefined);
returnStream.on('data', (quad: RDF.Quad) => { console.log(quad); }); returnStream.on('end', () => { console.log('Done!'); });
// At this stage, the store is empty, so no quads will be printed yet
// After importing some quads into the store, the s3-p3-o3 triple will be printed store.import(streamifyArray([ quad('s3', 'p3', 'o3'), quad('s4', 'p4', 'o4'), ]));
// After importing some more triples, another triple will be printed store.import(streamifyArray([ quad('sOther', 'p3', 'o3'), ]));
// Since we mark the store as ended, the returnStream will print Done!
store.end();
```
Determining if the store has ended
```typescript const store = new StreamingStore();
store.hasEnded(); // Will return false store.addEndListener(() => { console.log("store has ended"); });
store.addEndListener(() => { console.log("store has ended second call"); });
store.end(); // All the listeners will be called in the order they have been added
store.hasEnded(); // Will return true ```
License
This software is written by Maarten Vandenbrande and Ruben Taelman.
This code is released under the MIT license.
Owner
- Name: Comunica
- Login: comunica
- Kind: organization
- Location: Ghent, Belgium
- Website: https://comunica.dev
- Twitter: comunicajs
- Repositories: 69
- Profile: https://github.com/comunica
Flexible SPARQL and GraphQL over decentralized RDF on the Web.
GitHub Events
Total
- Delete event: 1
- Issue comment event: 7
- Push event: 46
- Pull request review event: 9
- Pull request review comment event: 11
- Pull request event: 6
- Fork event: 2
- Create event: 8
Last Year
- Delete event: 1
- Issue comment event: 7
- Push event: 46
- Pull request review event: 9
- Pull request review comment event: 11
- Pull request event: 6
- Fork event: 2
- Create event: 8
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Ruben Taelman | r****n@u****e | 25 |
| renovate[bot] | 2****] | 4 |
| Maarten Vandenbrande | 4****n | 2 |
| constraintAutomaton | c****n@p****m | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 4
- Total pull requests: 16
- Average time to close issues: about 2 months
- Average time to close pull requests: 4 months
- Total issue authors: 4
- Total pull request authors: 3
- Average comments per issue: 0.5
- Average comments per pull request: 3.31
- Merged pull requests: 4
- Bot issues: 1
- Bot pull requests: 9
Past Year
- Issues: 0
- Pull requests: 7
- Average time to close issues: N/A
- Average time to close pull requests: about 18 hours
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 1.43
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 3
Top Authors
Issue Authors
- rubensworks (1)
- renovate[bot] (1)
- maartyman (1)
- smessie (1)
Pull Request Authors
- renovate[bot] (12)
- maartyman (5)
- constraintAutomaton (4)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 13,622 last-month
- Total docker downloads: 10
- Total dependent packages: 1
- Total dependent repositories: 17
- Total versions: 12
- Total maintainers: 2
npmjs.org: rdf-streaming-store
A read-only RDF/JS store that allows parallel data lookup and insertion.
- Homepage: https://github.com/comunica/rdf-streaming-store.js#readme
- License: MIT
-
Latest release: 2.1.1
published over 1 year ago
Rankings
Maintainers (2)
Dependencies
- actions/cache v3 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/checkout v3 composite
- actions/setup-node v2 composite
- actions/setup-node v3 composite
- coverallsapp/github-action master composite
- @rubensworks/eslint-config ^1.1.0 development
- @types/jest ^29.0.0 development
- @typescript-eslint/eslint-plugin ^5.0.0 development
- @typescript-eslint/parser ^5.0.0 development
- arrayify-stream ^2.0.1 development
- coveralls ^3.0.0 development
- eslint ^8.32.0 development
- event-emitter-promisify ^1.1.0 development
- jest ^29.0.0 development
- jest-rdf ^1.5.0 development
- manual-git-changelog ^1.0.0 development
- pre-commit ^1.2.2 development
- rdf-data-factory ^1.1.1 development
- rdf-quad ^1.5.0 development
- streamify-array ^1.0.1 development
- ts-jest ^29.0.0 development
- ts-loader ^9.3.1 development
- typescript ^4.0.2 development
- webpack ^5.73.0 development
- webpack-cli ^5.0.0 development
- @rdfjs/types *
- @types/n3 ^1.10.4
- @types/readable-stream ^2.3.15
- n3 ^1.16.3
- rdf-string ^1.6.2
- rdf-terms ^1.9.1
- readable-stream ^4.3.0
- 671 dependencies