Class GraphBuilder


  • public final class GraphBuilder
    extends java.lang.Object

    Utility class for building a `Graph`

    Since:
    1.0
    Version:
    1.0
    Author:
    Michael Grove
    • Constructor Detail

      • GraphBuilder

        public GraphBuilder()
    • Method Detail

      • graph

        public java.util.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
                                   java.lang.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:
        theType - the type
        theRes - the individual
        Returns:
        a builder for the new individual
      • instance

        @Nonnull
        public ResourceBuilder instance​(@Nullable
                                        java.lang.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
      • list

        @Nonnull
        public Resource list​(@Nonnull
                             java.util.List<? extends Value> theList)
      • add

        public void add​(Statement theStatement)