JSPM

@rdfjs/io

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7610
  • Score
    100M100P100Q138194F
  • License MIT

I/O operations for RDF/JS streams and datasets

Package Exports

  • @rdfjs/io
  • @rdfjs/io/Factory.js
  • @rdfjs/io/index.js
  • @rdfjs/io/mediaTypes.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rdfjs/io) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@rdfjs/io

build status npm version

This package provides I/O operations for RDF/JS streams and datasets.

Usage

Depending on which kind of objects should be used for the I/O operations, there are three different options to import this package:

To import both, streams and datasets operations, use the main entrypoint:

import * as io from '@rdfjs/io'

If only dataset operations are required:

import * as datasetIo from '@rdfjs/io/dataset.js'

And, if only stream operations are required:

import * as streamIo from '@rdfjs/io/stream.js'

Factory Argument

All operations require a factory argument. The factory must be an Environment that bundles multiple other factories. FetchFactory and FormatsFactory are required for the stream operations. Additionally, the DatasetFactory is required for dataset operations.

Examples

The following example loads a dataset from the given URL:

import * as io from '@rdfjs/io'
import factory from './factory.js'

const url = 'https://housemd.rdf-ext.org/person/gregory-house'
const dataset = await io.dataset.fromURL(url, { factory })

The following example loads the quads of the given URL as a stream of quads:

import * as io from '@rdfjs/io'
import factory from './factory.js'

const url = 'https://housemd.rdf-ext.org/person/gregory-house'
const stream = io.stream.fromURL(url, { factory })