Class RdfN3Reader


  • public class RdfN3Reader
    extends RdfTurtleReader
    Handler of RDF content according to the N3 notation.
    • Constructor Detail

      • RdfN3Reader

        public RdfN3Reader​(Representation rdfN3Representation,
                           GraphHandler graphHandler)
                    throws java.io.IOException
        Constructor.
        Parameters:
        rdfRepresentation - The representation to read.
        graphHandler - The graph handler invoked during the parsing.
        Throws:
        java.io.IOException
    • Method Detail

      • getPredicate

        private Reference getPredicate​(LexicalUnit lexicalUnit)
        Returns the given lexical unit as a predicate.
        Parameters:
        lexicalUnit - The lexical unit to get as a predicate.
        Returns:
        A RDF URI reference of the predicate.
      • isDelimiter

        protected boolean isDelimiter​(int c)
        Description copied from class: RdfTurtleReader
        Returns true if the given character is a delimiter.
        Overrides:
        isDelimiter in class RdfTurtleReader
        Parameters:
        c - The given character to check.
        Returns:
        true if the given character is a delimiter.
      • isPath

        protected boolean isPath​(LexicalUnit lexicalUnit)
        Returns true if the given lexical unit is a "path" shorthand.
        Parameters:
        lexicalUnit - The lexical unit to analyse.
        Returns:
        True if the given lexical unit is a "path" shorthand.
      • link

        protected void link​(java.lang.Object source,
                            Reference typeRef,
                            java.lang.Object target)
        Callback method used when a link is parsed or written.
        Overrides:
        link in class RdfTurtleReader
        Parameters:
        source - The source or subject of the link.
        typeRef - The type reference of the link.
        target - The target or object of the link.
      • parseBlankNode

        protected void parseBlankNode​(BlankNodeToken blankNode)
                               throws java.io.IOException
        Description copied from class: RdfTurtleReader
        Parse the given blank node.
        Overrides:
        parseBlankNode in class RdfTurtleReader
        Parameters:
        blankNode - The blank node to parse.
        Throws:
        java.io.IOException
      • parseFormula

        protected void parseFormula​(FormulaToken formulaToken)
                             throws java.io.IOException
        Parses the given formula token.
        Parameters:
        formulaToken - The formula token to parse.
        Throws:
        java.io.IOException
      • parseList

        protected void parseList​(ListToken listToken)
                          throws java.io.IOException
        Description copied from class: RdfTurtleReader
        Parse the given list token.
        Overrides:
        parseList in class RdfTurtleReader
        Parameters:
        listToken - The list token to parse.
        Throws:
        java.io.IOException
      • parseStatement

        protected void parseStatement​(Context context)
                               throws java.io.IOException
        Description copied from class: RdfTurtleReader
        Reads the current statement until its end, and parses it.
        Overrides:
        parseStatement in class RdfTurtleReader
        Parameters:
        context - The current context.
        Throws:
        java.io.IOException