How to use rdf-test-suite - 2 common examples

To help you get started, we’ve selected a few rdf-test-suite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rubensworks / jsonld-streaming-serializer.js / spec / serializer.js View on Github external
serialize: function (data, baseIRI, options) {
    if (options.processingMode && options.processingMode !== '1.0') {
      return Promise.reject(
        new ErrorSkipped(`Test with processing mode ${options.processingMode} was skipped, only 1.0 is supported.`));
    }
    if (options.specVersion && options.specVersion !== '1.0') {
      return Promise.reject(
        new ErrorSkipped(`Test with spec version ${options.specVersion} was skipped, only 1.0 is supported.`));
    }
    return require('stream-to-string')(require('streamify-array')(data)
      .pipe(new JsonLdSerializer(Object.assign({ baseIRI, space: '  ', excludeContext: true }, options))));
  },
};
github rubensworks / jsonld-streaming-parser.js / spec / parser.js View on Github external
parse: function (data, baseIRI, options) {
    if (options.processingMode && options.processingMode !== '1.0') {
      return Promise.reject(
        new ErrorSkipped(`Test with processing mode ${options.processingMode} was skipped, only 1.0 is supported.`));
    }
    if (options.specVersion && options.specVersion !== '1.0') {
      return Promise.reject(
        new ErrorSkipped(`Test with spec version ${options.specVersion} was skipped, only 1.0 is supported.`));
    }
    return require('arrayify-stream')(require('streamify-string')(data)
      .pipe(new JsonLdParser(Object.assign({ baseIRI, allowOutOfOrderContext: true, validateValueIndexes: true }, options))));
  },
};

rdf-test-suite

Executes the RDF and SPARQL test suites.

MIT
Latest version published 1 year ago

Package Health Score

42 / 100
Full package analysis

Popular rdf-test-suite functions