The `jsonld-streaming-parser` package, currently at version 5.0.1, offers a high-performance and lightweight streaming parser specifically designed for JSON-LD 1.1 documents. It emphasizes full compliance with the JSON-LD 1.1 specification and outputs data in the RDFJS Quad format, ensuring broad compatibility within the RDF ecosystem. A significant advantage of this library is its streaming architecture, which allows it to process extremely large JSON-LD files that would exceed available memory, by emitting RDF triples incrementally as they are parsed. This makes it ideal for handling big data scenarios in the Semantic Web or for real-time Linked Data processing. The project demonstrates active maintenance, with continuous integration badges indicating robust testing and regular updates reflected in its versioning. Its core differentiator lies in its ability to handle both standard and streaming-profile JSON-LD documents efficiently, providing an essential tool for developers working with Linked Data.
npm install jsonld-streaming-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates parsing a JSON-LD string using `JsonLdParser` with `streamingProfile` enabled, importing the resulting RDFJS quads into an `N3.Store`, and then querying the stored data. Shows setup for async operations.
Ensure your JSON-LD documents are 1.1 compliant or upgrade existing documents. Remove `jsonLdContext` and `rdfjs` options. Migrate any logic relying on the internal `context` property to use the `parser.on('context', ...)` event listener.Instantiate the `JsonLdParser` with `{ streamingProfile: true }` in its constructor options if your input document benefits from this optimization.Instead of direct property access, listen to the `context` event emitted by the parser: `parser.on('context', (context) => { /* handle context */ });`.Carefully review your input JSON-LD for correctness. Use a JSON-LD linter or validator (e.g., online JSON-LD playground) to identify specific syntax issues.
Standardize your project on either ES Modules (using `import` and setting `"type": "module"` in `package.json`) or CommonJS (using `require`). For new development, ES Modules are generally recommended.