org.eclipse.rdf4j.sparqlbuilder.rdf

## Class Rdf

- java.lang.Object
- - org.eclipse.rdf4j.sparqlbuilder.rdf.Rdf

-     public class Rdf
      extends Object

  A class with static methods to create basic `SparqlBuilder` RDF objects from either string values or RDF4J Model objects.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RdfBlankNode.AnonymousBlankNode` | `bNode()` create an empty anonymous blank node
    `static RdfBlankNode.PropertiesBlankNode` | `bNode(RdfPredicate predicate, RdfObject... objects)` creates a label-less blank node, identified by the supplied predicate-object lists
    `static RdfBlankNode.LabeledBlankNode` | `bNode(String label)` creates a labeled blank node
    `static Iri` | `iri(IRI iri)` Create a SparqlBuilder Iri instance from an `IRI`
    `static Iri` | `iri(String iriString)` Create a SparqlBuilder Iri instance from a String iri
    `static Iri` | `iri(String namespace, String localName)` Create a SparqlBuilder Iri instance from a namespace and local name
    `static RdfLiteral.BooleanLiteral` | `literalOf(Boolean boolValue)` create an RDF boolean literal
    `static RdfLiteral.NumericLiteral` | `literalOf(Number numberValue)` create an RDF numeric literal
    `static RdfLiteral.StringLiteral` | `literalOf(String stringValue)` create an RDF string literal
    `static RdfLiteral.StringLiteral` | `literalOfLanguage(String stringValue, String language)` create a literal with a language tag
    `static RdfLiteral.StringLiteral` | `literalOfType(String stringValue, Iri dataType)` create a literal with a datatype
    `static RdfLiteral.StringLiteral` | `literalOfType(String stringValue, IRI dataType)` create a literal with a datatype
    `static RdfObject` | `object(Value value)` Converts an object `Value`s to an `RdfObject`s.
    `static RdfObject[]` | `objects(Value... values)` Converts an array of object `Value`s to an array of `RdfObject`s.
    `static RdfPredicateObjectList` | `predicateObjectList(RdfPredicate predicate, RdfObject... objects)` Create a `RdfPredicateObjectList`
    `static RdfPredicateObjectListCollection` | `predicateObjectListCollection(RdfPredicateObjectList... predicateObjectLists)` Create a `RdfPredicateObjectListCollection` with the given `RdfPredicateObjectList`(s)
    `static RdfPredicateObjectListCollection` | `predicateObjectListCollection(RdfPredicate predicate, RdfObject... objects)` Create a `RdfPredicateObjectListCollection` with an initial `RdfPredicateObjectList`
    `static RdfLiteral.BooleanLiteral[]` | `toRdfLiteralArray(Boolean... literals)` Convert an array of `Boolean`s to an array of `RdfLiteral.BooleanLiteral`s
    `static RdfLiteral.NumericLiteral[]` | `toRdfLiteralArray(Number... literals)` Convert an array of `Number`s to an array of `RdfLiteral.NumericLiteral`s
    `static RdfLiteral.StringLiteral[]` | `toRdfLiteralArray(String... literals)` Convert an array of `String`s to an array of `RdfLiteral.StringLiteral`s

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

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

- - ### Method Detail

    - #### iri

          public static Iri iri(String iriString)

      Create a SparqlBuilder Iri instance from a String iri
      Parameters:
        `iriString` - the String representing the iri
      Returns:
        the `Iri` instance

    - #### iri

          public static Iri iri(IRI iri)

      Create a SparqlBuilder Iri instance from an `IRI`
      Parameters:
        `iri` - the IRI
      Returns:
        the SparqlBuilder `Iri` instance

    - #### iri

          public static Iri iri(String namespace,
                                String localName)

      Create a SparqlBuilder Iri instance from a namespace and local name
      Parameters:
        `namespace` - the namespace of the Iri
        `localName` - the local name of the Iri
      Returns:
        a `Iri` instance

    - #### bNode

          public static RdfBlankNode.LabeledBlankNode bNode(String label)

      creates a labeled blank node
      Parameters:
        `label` - the label of the blank node
      Returns:
        a new `RdfBlankNode.LabeledBlankNode` instance

    - #### bNode

          public static RdfBlankNode.PropertiesBlankNode bNode(RdfPredicate predicate,
                                                               RdfObject... objects)

      creates a label-less blank node, identified by the supplied predicate-object lists
      Parameters:
        `predicate` - the predicate of the initial predicate-object list to populate this blank node with
        `objects` - the objects of the initial predicate-object list to populate this blank node with
      Returns:
        a new `RdfBlankNode.PropertiesBlankNode` instance
      See Also:
        Blank node syntax

    - #### bNode

          public static RdfBlankNode.AnonymousBlankNode bNode()

      create an empty anonymous blank node
      Returns:
        an empty `RdfBlankNode.AnonymousBlankNode` instance

    - #### literalOf

          public static RdfLiteral.StringLiteral literalOf(String stringValue)

      create an RDF string literal
      Parameters:
        `stringValue` - the String instance to create a literal from
      Returns:
        a `RdfLiteral.StringLiteral` instance representing the given String

    - #### literalOfType

          public static RdfLiteral.StringLiteral literalOfType(String stringValue,
                                                               Iri dataType)

      create a literal with a datatype
      Parameters:
        `stringValue` - the literal string
        `dataType` - the datatype tag
      Returns:
        a `RdfLiteral.StringLiteral` instance representing the given String and datatype

    - #### literalOfType

          public static RdfLiteral.StringLiteral literalOfType(String stringValue,
                                                               IRI dataType)

      create a literal with a datatype
      Parameters:
        `stringValue` - the literal string
        `dataType` - the datatype as a `IRI`
      Returns:
        a `RdfLiteral.StringLiteral` instance representing the given String and datatype

    - #### literalOfLanguage

          public static RdfLiteral.StringLiteral literalOfLanguage(String stringValue,
                                                                   String language)

      create a literal with a language tag
      Parameters:
        `stringValue` - the literal string
        `language` - the language tag
      Returns:
        a `RdfLiteral.StringLiteral` instance representing the given String and language

    - #### literalOf

          public static RdfLiteral.NumericLiteral literalOf(Number numberValue)

      create an RDF numeric literal
      Parameters:
        `numberValue` - the Number instance to create a literal from
      Returns:
        a `RdfLiteral.NumericLiteral` instance representing the given Number

    - #### literalOf

          public static RdfLiteral.BooleanLiteral literalOf(Boolean boolValue)

      create an RDF boolean literal
      Parameters:
        `boolValue` - the boolean to create a literal from
      Returns:
        a `RdfLiteral.BooleanLiteral` instance representing the given boolean

    - #### predicateObjectList

          public static RdfPredicateObjectList predicateObjectList(RdfPredicate predicate,
                                                                   RdfObject... objects)

      Create a `RdfPredicateObjectList`
      Parameters:
        `predicate` - the `RdfPredicate` of the predicate-object list
        `objects` - the `RdfObject`(s) of the list
      Returns:
        a new `RdfPredicateObjectList`

    - #### predicateObjectListCollection

          public static RdfPredicateObjectListCollection predicateObjectListCollection(RdfPredicate predicate,
                                                                                       RdfObject... objects)

      Create a `RdfPredicateObjectListCollection` with an initial `RdfPredicateObjectList`
      Parameters:
        `predicate` - the `RdfPredicate` of the initial `RdfPredicateObjectList`
        `objects` - the `RdfObject`(s) of the initial `RdfPredicateObjectList`
      Returns:
        a new `RdfPredicateObjectListCollection`

    - #### predicateObjectListCollection

          public static RdfPredicateObjectListCollection predicateObjectListCollection(RdfPredicateObjectList... predicateObjectLists)

      Create a `RdfPredicateObjectListCollection` with the given `RdfPredicateObjectList`(s)
      Parameters:
        `predicateObjectLists` - the `RdfPredicateObjectList`(s) to add to the collection
      Returns:
        a new `RdfPredicateObjectListCollection`

    - #### objects

          public static RdfObject[] objects(Value... values)

      Converts an array of object `Value`s to an array of `RdfObject`s.
      Parameters:
        `values` - an array of `Value`.
      Returns:
        an array of `RdfObject`

    - #### object

          public static RdfObject object(Value value)

      Converts an object `Value`s to an `RdfObject`s.
      Parameters:
        `value` - an RDF `Value`.
      Returns:
        an `RdfObject`

    - #### toRdfLiteralArray

          public static RdfLiteral.StringLiteral[] toRdfLiteralArray(String... literals)

      Convert an array of `String`s to an array of `RdfLiteral.StringLiteral`s
      Parameters:
        `literals` - the `String`s to convert
      Returns:
        an array of the corresponding `RdfLiteral.StringLiteral`s

    - #### toRdfLiteralArray

          public static RdfLiteral.BooleanLiteral[] toRdfLiteralArray(Boolean... literals)

      Convert an array of `Boolean`s to an array of `RdfLiteral.BooleanLiteral`s
      Parameters:
        `literals` - the `Boolean`s to convert
      Returns:
        an array of the corresponding `RdfLiteral.BooleanLiteral`s

    - #### toRdfLiteralArray

          public static RdfLiteral.NumericLiteral[] toRdfLiteralArray(Number... literals)

      Convert an array of `Number`s to an array of `RdfLiteral.NumericLiteral`s
      Parameters:
        `literals` - the `Number`s to convert
      Returns:
        an array of the corresponding `RdfLiteral.NumericLiteral`s

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