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 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)