Class AbstractRDFParser

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected RDFHandler rdfHandler
      The RDFHandler that will handle the parsed RDF.
      protected org.eclipse.rdf4j.model.ValueFactory valueFactory
      The ValueFactory to use for creating RDF model objects.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractRDFParser()
      Creates a new RDFParserBase that will use a SimpleValueFactory to create RDF model objects.
      protected AbstractRDFParser​(org.eclipse.rdf4j.model.ValueFactory valueFactory)
      Creates a new RDFParserBase that will use the supplied ValueFactory to create RDF model objects.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void clear()
      Clears any information that has been collected while parsing.
      protected void clearBNodeIDMap()
      Deprecated.
      Map is no longer used, call clear() instead.
      protected org.eclipse.rdf4j.model.BNode createBNode()
      Deprecated.
      protected org.eclipse.rdf4j.model.BNode createBNode​(String nodeID)
      Deprecated.
      protected org.eclipse.rdf4j.model.Literal createLiteral​(String label, String lang, org.eclipse.rdf4j.model.IRI datatype)
      Creates a Literal object with the supplied parameters.
      protected org.eclipse.rdf4j.model.Literal createLiteral​(String label, String lang, org.eclipse.rdf4j.model.IRI datatype, long lineNo, long columnNo)
      Creates a Literal object with the supplied parameters, using the lineNo and columnNo to enhance error messages or exceptions that may be generated during the creation of the literal.
      protected org.eclipse.rdf4j.model.Resource createNode()
      Creates a new BNode or Skolem IRI object.
      protected org.eclipse.rdf4j.model.Resource createNode​(String nodeID)
      Creates a BNode or Skolem IRI object for the specified identifier.
      protected org.eclipse.rdf4j.model.Statement createStatement​(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj)
      Creates a new Statement object with the supplied components.
      protected org.eclipse.rdf4j.model.Statement createStatement​(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource context)
      Creates a new Statement object with the supplied components.
      protected org.eclipse.rdf4j.model.IRI createURI​(String uri)
      Creates a IRI object for the specified URI-string.
      protected String getNamespace​(String prefix)
      Gets the namespace that is associated with the specified prefix or throws an RDFParseException.
      ParseErrorListener getParseErrorListener()  
      ParseLocationListener getParseLocationListener()  
      ParserConfig getParserConfig()
      Retrieves the current parser configuration as a single object.
      RDFHandler getRDFHandler()  
      Collection<RioSetting<?>> getSupportedSettings()  
      protected void initializeNamespaceTableFromConfiguration()  
      boolean preserveBNodeIDs()  
      protected void reportError​(Exception e, long lineNo, long columnNo, RioSetting<Boolean> relevantSetting)
      Reports an error with associated line- and column number to the registered ParseErrorListener, if the given setting has been set to true.
      protected void reportError​(Exception e, RioSetting<Boolean> relevantSetting)
      Reports an error with associated line- and column number to the registered ParseErrorListener, if the given setting has been set to true.
      protected void reportError​(String msg, long lineNo, long columnNo, RioSetting<Boolean> relevantSetting)
      Reports an error with associated line- and column number to the registered ParseErrorListener, if the given setting has been set to true.
      protected void reportError​(String msg, Exception e, long lineNo, long columnNo, RioSetting<Boolean> relevantSetting)
      Reports an error with associated line- and column number to the registered ParseErrorListener, if the given setting has been set to true.
      protected void reportError​(String msg, RioSetting<Boolean> relevantSetting)
      Reports an error with associated line- and column number to the registered ParseErrorListener, if the given setting has been set to true.
      protected void reportFatalError​(Exception e)
      Reports a fatal error to the registered ParseErrorListener, if any, and throws a ParseException afterwards.
      protected void reportFatalError​(Exception e, long lineNo, long columnNo)
      Reports a fatal error with associated line- and column number to the registered ParseErrorListener, if any, and throws a ParseException wrapped the supplied exception afterwards.
      protected void reportFatalError​(String msg)
      Reports a fatal error to the registered ParseErrorListener, if any, and throws a ParseException afterwards.
      protected void reportFatalError​(String msg, long lineNo, long columnNo)
      Reports a fatal error with associated line- and column number to the registered ParseErrorListener, if any, and throws a ParseException afterwards.
      protected void reportFatalError​(String message, Exception e, long lineNo, long columnNo)
      Reports a fatal error with associated line- and column number to the registered ParseErrorListener, if any, and throws a ParseException wrapped the supplied exception afterwards.
      protected void reportLocation​(long lineNo, long columnNo)
      Reports the specified line- and column number to the registered ParseLocationListener, if any.
      protected void reportWarning​(String msg)
      Reports a warning to the registered ParseErrorListener, if any.
      protected void reportWarning​(String msg, long lineNo, long columnNo)
      Reports a warning with associated line- and column number to the registered ParseErrorListener, if any.
      protected org.eclipse.rdf4j.model.IRI resolveURI​(String uriSpec)
      Resolves a URI-string against the base URI and creates a IRI object for it.
      <T> RDFParser set​(RioSetting<T> setting, T value)
      Set a setting on the parser, and return this parser object to allow chaining.
      protected void setBaseURI​(String uriSpec)
      Parses the supplied URI-string and sets it as the base URI for resolving relative URIs.
      protected void setBaseURI​(org.eclipse.rdf4j.common.net.ParsedIRI baseURI)
      Sets the base URI for resolving relative URIs.
      protected void setNamespace​(String prefix, String namespace)
      Associates the specified prefix to the specified namespace.
      RDFParser setParseErrorListener​(ParseErrorListener el)
      Sets the ParseErrorListener that will be notified of any errors that this parser finds during parsing.
      RDFParser setParseLocationListener​(ParseLocationListener el)
      Sets the ParseLocationListener that will be notified of the parser's progress during the parse process.
      RDFParser setParserConfig​(ParserConfig config)
      Sets all supplied parser configuration options.
      void setPreserveBNodeIDs​(boolean preserveBNodeIDs)
      Set whether the parser should preserve bnode identifiers specified in the source (default is false).
      RDFParser setRDFHandler​(RDFHandler handler)
      Sets the RDFHandler that will handle the parsed RDF data.
      RDFParser setValueFactory​(org.eclipse.rdf4j.model.ValueFactory valueFactory)
      Sets the ValueFactory that the parser will use to create Value objects for the parsed RDF data.
    • Field Detail

      • rdfHandler

        protected RDFHandler rdfHandler
        The RDFHandler that will handle the parsed RDF.
      • valueFactory

        protected org.eclipse.rdf4j.model.ValueFactory valueFactory
        The ValueFactory to use for creating RDF model objects.
    • Constructor Detail

      • AbstractRDFParser

        protected AbstractRDFParser()
        Creates a new RDFParserBase that will use a SimpleValueFactory to create RDF model objects.
      • AbstractRDFParser

        protected AbstractRDFParser​(org.eclipse.rdf4j.model.ValueFactory valueFactory)
        Creates a new RDFParserBase that will use the supplied ValueFactory to create RDF model objects.
        Parameters:
        valueFactory - A ValueFactory.