Class: SparqlXmlResultParser

SparqlXmlResultParser(config)

Parse a sparql tuple query xml result and convert it RDFJS-based data structure.

A custom parser library is used for the parsing. Also the N3 DataFactory is used for building the data objects instead of the native RDFJS datafactory as there are some minor discrepancies in between them and we already stuck to N3 as a default implementation.

Constructor

new SparqlXmlResultParser(config)

Parameters:
Name Type Description
config Object

is an object containing the parser configuration.

Author:
  • Mihail Radkov
  • Svilen Velikov
Source:

Methods

getSupportedType()

Source:

isStreaming()

Source:

parse(stream, configopt) → {NodeJS.ReadableStream|Promise.<boolean>}

This method should be invoked with a text stream and will return also a stream converted to RDFJS objects.

Client of the method can subscribe to following events in order to consume the stream: stream.on('variables', (variables) => console.log(variables)); stream.on('data', (bindings) => console.log(bindings)); stream.on('error', (error) => console.log(error));

Parameters:
Name Type Attributes Description
stream NodeJS.ReadableStream

with the text which has to be parsed to given format.

config Object <optional>

optional parser configuration.

Source:
Returns:

a stream with the converted content for SELECT queries and a Promise which resolves to boolean value for ASK queries.

Type
NodeJS.ReadableStream | Promise.<boolean>