org.eclipse.rdf4j.rio.jsonld

## Class JSONLDParser

- java.lang.Object
- - org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
  - - org.eclipse.rdf4j.rio.jsonld.JSONLDParser

- All Implemented Interfaces:
    RDFParser
  Direct Known Subclasses:
    NDJSONLDParser

      public class JSONLDParser
      extends AbstractRDFParser
      implements RDFParser

  An `RDFParser` that links to `JSONLDInternalTripleCallback`.
  Author:
    Peter Ansell

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.rdf4j.rio.RDFParser

      `RDFParser.DatatypeHandling`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser

      `rdfHandler, valueFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONLDParser()` Default constructor
    `JSONLDParser(ValueFactory valueFactory)` Creates a Sesame JSONLD Parser using the given `ValueFactory` to create new `Value`s.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `getJSONObject(InputStream in, Reader reader, com.fasterxml.jackson.core.JsonFactory factory)`
    `RDFFormat` | `getRDFFormat()` Gets the RDF format that this parser can parse.
    `Collection<RioSetting<?>>` | `getSupportedSettings()`
    `void` | `parse(InputStream in, String baseURI)` Parses the data from the supplied InputStream, using the supplied baseURI to resolve any relative URI references.
    `void` | `parse(Reader reader, String baseURI)` Parses the data from the supplied Reader, using the supplied baseURI to resolve any relative URI references.

    - ### Methods inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser

      `clear, clearBNodeIDMap, createBNode, createBNode, createLiteral, createLiteral, createNode, createNode, createStatement, createStatement, createURI, datatypeHandling, getNamespace, getParseErrorListener, getParseLocationListener, getParserConfig, getRDFHandler, initializeNamespaceTableFromConfiguration, preserveBNodeIDs, reportError, reportError, reportError, reportError, reportError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportLocation, reportWarning, reportWarning, resolveURI, set, setBaseURI, setBaseURI, setDatatypeHandling, setNamespace, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setStopAtFirstError, setValueFactory, setVerifyData, stopAtFirstError, verifyData`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.rio.RDFParser

      `getParserConfig, parse, parse, set, setDatatypeHandling, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setStopAtFirstError, setValueFactory, setVerifyData`

- - ### Constructor Detail

    - #### JSONLDParser

          public JSONLDParser()

      Default constructor

    - #### JSONLDParser

          public JSONLDParser(ValueFactory valueFactory)

      Creates a Sesame JSONLD Parser using the given `ValueFactory` to create new `Value`s.
      Parameters:
        `valueFactory` - The ValueFactory to use

  - ### Method Detail

    - #### getRDFFormat

          public RDFFormat getRDFFormat()

      Description copied from interface: `RDFParser`
      Gets the RDF format that this parser can parse.
      Specified by:
        `getRDFFormat` in interface `RDFParser`

    - #### getSupportedSettings

          public Collection<RioSetting<?>> getSupportedSettings()

      Specified by:
        `getSupportedSettings` in interface `RDFParser`
      Overrides:
        `getSupportedSettings` in class `AbstractRDFParser`
      Returns:
        A collection of `RioSetting`s that are supported by this RDFParser.

    - #### parse

          public void parse(InputStream in,
                            String baseURI)
                     throws IOException,
                            RDFParseException,
                            RDFHandlerException

      Description copied from interface: `RDFParser`
      Parses the data from the supplied InputStream, using the supplied baseURI to resolve any relative URI references.
      Specified by:
        `parse` in interface `RDFParser`
      Parameters:
        `in` - The InputStream from which to read the data.
        `baseURI` - The URI associated with the data in the InputStream. May be `null`. Parsers for syntax formats that do not support relative URIs will ignore this argument.

        Note that if the data contains an embedded base URI, that embedded base URI will overrule the value supplied here (see RFC 3986 section 5.1 for details).

      Throws:
        `IOException` - If an I/O error occurred while data was read from the InputStream.
        `RDFParseException` - If the parser has found an unrecoverable parse error.
        `RDFHandlerException` - If the configured statement handler has encountered an unrecoverable error.

    - #### parse

          public void parse(Reader reader,
                            String baseURI)
                     throws IOException,
                            RDFParseException,
                            RDFHandlerException

      Description copied from interface: `RDFParser`
      Parses the data from the supplied Reader, using the supplied baseURI to resolve any relative URI references.
      Specified by:
        `parse` in interface `RDFParser`
      Parameters:
        `reader` - The Reader from which to read the data.
        `baseURI` - The URI associated with the data in the InputStream. May be `null`. Parsers for syntax formats that do not support relative URIs will ignore this argument.

        Note that if the data contains an embedded base URI, that embedded base URI will overrule the value supplied here (see RFC 3986 section 5.1 for details).

      Throws:
        `IOException` - If an I/O error occurred while data was read from the InputStream.
        `RDFParseException` - If the parser has found an unrecoverable parse error.
        `RDFHandlerException` - If the configured statement handler has encountered an unrecoverable error.

    - #### getJSONObject

          protected Object getJSONObject(InputStream in,
                                         Reader reader,
                                         com.fasterxml.jackson.core.JsonFactory factory)
                                  throws IOException

      Throws:
        `IOException`

Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.