Package com.stardog.stark.util

# Class GraphBuilder

java.lang.Object
com.stardog.stark.util.GraphBuilder

public final class GraphBuilder extends Object

Utility class for building a `Graph`

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GraphBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(Statement theStatement)`
  `ResourceBuilder`
  `bnode()`
  `Set<Statement>`
  `graph()`
  Return the Graph created via this builder
  `ResourceBuilder`
  `instance(IRI theType)`
  Create a new anonymous instance of the given type
  `ResourceBuilder`
  `instance(Resource theRes, IRI theType)`
  Create a `builder` for the given individual and add the type
  `ResourceBuilder`
  `instance(String theURI, IRI theType)`
  Create a `builder` for the given individual and add the type
  `ResourceBuilder`
  `iri(IRI theURI)`
  Create a `builder` for the individual
  `ResourceBuilder`
  `iri(String theURI)`
  Create a `builder` for the individual
  `Resource`
  `list(List<? extends Value> theList)`
  `void`
  `reset()`
  Clear the contents of the builder
  `ResourceBuilder`
  `resource(Resource theRes)`

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

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

- ## Constructor Details

  - ### GraphBuilder

    public GraphBuilder()

- ## Method Details

  - ### graph

    public Set<Statement> graph()
    Return the Graph created via this builder
    Returns:
      the graph

  - ### reset

    public void reset()
    Clear the contents of the builder

  - ### iri

    @Nonnull public ResourceBuilder iri(@Nonnull IRI theURI)
    Create a `builder` for the individual
    Parameters:
      `theURI` - the individual
    Returns:
      the `builder`

  - ### iri

    @Nonnull public ResourceBuilder iri(@Nonnull String theURI)
    Create a `builder` for the individual
    Parameters:
      `theURI` - the individual
    Returns:
      the `builder`

  - ### instance

    @Nonnull public ResourceBuilder instance(@Nonnull IRI theType)
    Create a new anonymous instance of the given type
    Parameters:
      `theType` - the type
    Returns:
      a `builder` for the new individual

  - ### instance

    @Nonnull public ResourceBuilder instance(@Nonnull Resource theRes, @Nonnull IRI theType)
    Create a `builder` for the given individual and add the type
    Parameters:
      `theRes` - the individual
      `theType` - the type
    Returns:
      a `builder` for the new individual

  - ### instance

    @Nonnull public ResourceBuilder instance(@Nullable String theURI, @Nullable IRI theType)
    Create a `builder` for the given individual and add the type
    Parameters:
      `theURI` - the individual
      `theType` - the type
    Returns:
      a `builder` for the new individual

  - ### bnode

    public ResourceBuilder bnode()

  - ### resource

    @Nonnull public ResourceBuilder resource(@Nonnull Resource theRes)

  - ### list

    @Nonnull public Resource list(@Nonnull List<? extends Value> theList)

  - ### add

    public void add(Statement theStatement)