org.eclipse.rdf4j.rio.trig

## Class TriGParser

- java.lang.Object
- - org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
  - - org.eclipse.rdf4j.rio.turtle.TurtleParser
    - - org.eclipse.rdf4j.rio.trig.TriGParser

- All Implemented Interfaces:
    RDFParser
  Direct Known Subclasses:
    TriGStarParser

      public class TriGParser
      extends TurtleParser

  RDF parser for RDF-1.1 TriG files. This parser is not thread-safe, therefore its public methods are synchronized.
  Author:
    Arjohn Kampman, Peter Ansell
  See Also:
    `TurtleParser`

- - ### 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.turtle.TurtleParser

      `object, predicate, subject`

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

      `rdfHandler, valueFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TriGParser()` Creates a new TriGParser that will use a `SimpleValueFactory` to create RDF model objects.
    `TriGParser(ValueFactory valueFactory)` Creates a new TriGParser that will use the supplied ValueFactory to create RDF model objects.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Resource` | `getContext()`
    `RDFFormat` | `getRDFFormat()` Gets the RDF format that this parser can parse.
    `protected void` | `parseGraph()`
    `protected void` | `parseStatement()`
    `protected void` | `parseTriples()`
    `protected void` | `reportStatement(Resource subj, IRI pred, Value obj)`
    `protected void` | `setContext(Resource context)`

    - ### Methods inherited from class org.eclipse.rdf4j.rio.turtle.TurtleParser

      `getLineNumber, getSupportedSettings, parse, parse, parseAnnotation, parseBase, parseCollection, parseDirective, parseImplicitBlank, parseLongString, parseNodeID, parseNumber, parseObject, parseObjectList, parsePredicate, parsePredicateObjectList, parsePrefixID, parseQNameOrBoolean, parseQuotedLiteral, parseQuotedString, parseString, parseSubject, parseTripleValue, parseURI, parseValue, peekCodePoint, peekIsTripleValue, processComment, readCodePoint, reportError, reportFatalError, reportFatalError, reportLocation, reportWarning, skipWSC, throwEOFException, unread, unread, verifyCharacterOrFail`

    - ### 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, reportFatalError, reportFatalError, reportFatalError, reportLocation, 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

      `parse, parse`

- - ### Constructor Detail

    - #### TriGParser

          public TriGParser()

      Creates a new TriGParser that will use a `SimpleValueFactory` to create RDF model objects.

    - #### TriGParser

          public TriGParser(ValueFactory valueFactory)

      Creates a new TriGParser that will use the supplied ValueFactory to create RDF model objects.
      Parameters:
        `valueFactory` - A ValueFactory.

  - ### 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`
      Overrides:
        `getRDFFormat` in class `TurtleParser`

    - #### parseStatement

          protected void parseStatement()
                                 throws IOException,
                                        RDFParseException,
                                        RDFHandlerException

      Overrides:
        `parseStatement` in class `TurtleParser`
      Throws:
        `IOException`
        `RDFParseException`
        `RDFHandlerException`

    - #### parseGraph

          protected void parseGraph()
                             throws IOException,
                                    RDFParseException,
                                    RDFHandlerException

      Throws:
        `IOException`
        `RDFParseException`
        `RDFHandlerException`

    - #### parseTriples

          protected void parseTriples()
                               throws IOException,
                                      RDFParseException,
                                      RDFHandlerException

      Overrides:
        `parseTriples` in class `TurtleParser`
      Throws:
        `IOException`
        `RDFParseException`
        `RDFHandlerException`

    - #### reportStatement

          protected void reportStatement(Resource subj,
                                         IRI pred,
                                         Value obj)
                                  throws RDFParseException,
                                         RDFHandlerException

      Overrides:
        `reportStatement` in class `TurtleParser`
      Throws:
        `RDFParseException`
        `RDFHandlerException`

    - #### setContext

          protected void setContext(Resource context)

    - #### getContext

          protected Resource getContext()

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