Interface RdfQuadConsumer

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface RdfQuadConsumer
    RDF quad consumer interface designed for high-performance processing and seamless integration with third-party libraries.

    This interface minimizes unnecessary object instantiation, improving efficiency when handling RDF data at scale.

    Use the provided static helper methods to analyze and validate consumer parameters.

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static boolean isBlank​(java.lang.String resource)
      Checks whether the provided resource identifier represents a blank node.
      static boolean isDirLangString​(java.lang.String datatype, java.lang.String language, java.lang.String direction)
      Determines if the provided combination of datatype, language, and direction qualifies the object as an RDF directional language-tagged string literal with a specified direction.
      static boolean isLangString​(java.lang.String datatype, java.lang.String language, java.lang.String direction)
      Determines if the provided combination of datatype, language, and direction qualifies the object as an RDF language-tagged string literal with no specified direction.
      static boolean isLiteral​(java.lang.String datatype, java.lang.String language, java.lang.String direction)
      Determines if the provided combination of datatype, language, and direction qualifies the object as RDF literal.
      static boolean isValidObject​(java.lang.String datatype, java.lang.String language, java.lang.String direction)
      Validates whether the object is a valid RDF object based on the presence of datatype, language, and direction.
      RdfQuadConsumer quad​(java.lang.String subject, java.lang.String predicate, java.lang.String object, java.lang.String datatype, java.lang.String language, java.lang.String direction, java.lang.String graph)
      Consumes an RDF quad where the object may be an IRI, blank node, typed literal, or language-tagged literal.
    • Method Detail

      • quad

        RdfQuadConsumer quad​(java.lang.String subject,
                             java.lang.String predicate,
                             java.lang.String object,
                             java.lang.String datatype,
                             java.lang.String language,
                             java.lang.String direction,
                             java.lang.String graph)
                      throws RdfConsumerException
        Consumes an RDF quad where the object may be an IRI, blank node, typed literal, or language-tagged literal.

        This method provides fine-grained control over RDF quad data, allowing precise handling of datatypes, language tags, and text direction.

        Parameters:
        subject - the subject of the quad; must be an IRI or blank node identifier prefixed with "_:". Must not be null.
        predicate - the predicate of the quad; must be an IRI. Must not be null.
        object - the object of the quad; must be either:
        • an IRI
        • a blank node identifier prefixed with "_:"
        • a literal value, when datatype is not null
        Must not be null.

        Use isValidObject(String, String, String), isLiteral(String, String, String), isLangString(String, String, String), and isDirLangString(String, String, String) to validate and classify the input.

        datatype - the datatype IRI of the literal. Must be null if object is not a literal. Must not be null when language or direction is provided.
        language - the language tag of the literal. May be null, but must not be null if direction is provided.
        direction - the text direction of the literal. Optional; may be null.
        graph - the graph name of the quad; must be an IRI or blank node identifier prefixed with "_:". May be null to indicate the default graph.
        Returns:
        a reference to this consumer, enabling fluent chaining; never null.
        Throws:
        RdfConsumerException - if an error occurs while processing the quad statement.
      • isLiteral

        static boolean isLiteral​(java.lang.String datatype,
                                 java.lang.String language,
                                 java.lang.String direction)
        Determines if the provided combination of datatype, language, and direction qualifies the object as RDF literal.
        Parameters:
        datatype - the datatype IRI
        language - the language tag
        direction - the text direction
        Returns:
        true indicating a literal, otherwise false.
      • isLangString

        static boolean isLangString​(java.lang.String datatype,
                                    java.lang.String language,
                                    java.lang.String direction)
        Determines if the provided combination of datatype, language, and direction qualifies the object as an RDF language-tagged string literal with no specified direction.
        Parameters:
        datatype - the datatype IRI
        language - the language tag
        direction - the text direction
        Returns:
        true if the provided object is RDF language-tagged literal, otherwise false.
      • isDirLangString

        static boolean isDirLangString​(java.lang.String datatype,
                                       java.lang.String language,
                                       java.lang.String direction)
        Determines if the provided combination of datatype, language, and direction qualifies the object as an RDF directional language-tagged string literal with a specified direction.
        Parameters:
        datatype - the datatype IRI
        language - the language tag
        direction - the text direction
        Returns:
        true if the provided object is RDF directional language-tagged literal, otherwise false.
      • isValidObject

        static boolean isValidObject​(java.lang.String datatype,
                                     java.lang.String language,
                                     java.lang.String direction)
        Validates whether the object is a valid RDF object based on the presence of datatype, language, and direction.
        Parameters:
        datatype - the datatype IRI
        language - the language tag
        direction - the text direction
        Returns:
        true if the object is valid according to RDF term rules.
      • isBlank

        static boolean isBlank​(java.lang.String resource)
        Checks whether the provided resource identifier represents a blank node. A blank node identifier must start with "_:".
        Parameters:
        resource - the resource identifier to check; may be null.
        Returns:
        true if the resource is a non-null blank node identifier; otherwise false.