Class JsonLdUnionGraphImpl

java.lang.Object
org.apache.commons.rdf.jsonldjava.AbstractJsonLdGraphLike<Triple>
org.apache.commons.rdf.jsonldjava.JsonLdUnionGraphImpl
All Implemented Interfaces:
AutoCloseable, Graph, GraphLike<Triple>, JsonLdGraphLike<Triple>, JsonLdUnionGraph

class JsonLdUnionGraphImpl extends AbstractJsonLdGraphLike<Triple> implements JsonLdUnionGraph
  • Constructor Details

    • JsonLdUnionGraphImpl

      JsonLdUnionGraphImpl(String bnodePrefix)
    • JsonLdUnionGraphImpl

      JsonLdUnionGraphImpl(com.github.jsonldjava.core.RDFDataset rdfDataSet)
    • JsonLdUnionGraphImpl

      JsonLdUnionGraphImpl(com.github.jsonldjava.core.RDFDataset rdfDataSet, String bnodePrefix)
  • Method Details

    • add

      public void add(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
      Description copied from interface: Graph
      Adds a triple to the graph, possibly mapping any of the components to those supported by this Graph.
      Specified by:
      add in interface Graph
      Parameters:
      subject - The triple subject
      predicate - The triple predicate
      object - The triple object
    • contains

      public boolean contains(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
      Description copied from interface: Graph
      Checks if graph contains a pattern of triples.
      Specified by:
      contains in interface Graph
      Parameters:
      subject - The triple subject (null is a wildcard)
      predicate - The triple predicate (null is a wildcard)
      object - The triple object (null is a wildcard)
      Returns:
      True if the Graph contains any Triples that match the given pattern.
    • remove

      public void remove(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
      Description copied from interface: Graph
      Removes a concrete pattern of triples from the graph.
      Specified by:
      remove in interface Graph
      Parameters:
      subject - The triple subject (null is a wildcard)
      predicate - The triple predicate (null is a wildcard)
      object - The triple object (null is a wildcard)
    • remove

      public void remove(Triple t)
      Description copied from interface: GraphLike
      Add a statement.
      Specified by:
      remove in interface Graph
      Specified by:
      remove in interface GraphLike<Triple>
      Parameters:
      t - The TripleLike statement to add
    • stream

      public Stream<JsonLdTriple> stream(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
      Description copied from interface: Graph
      Gets all triples contained by the graph matched with the pattern.

      The iteration does not contain any duplicate triples, as determined by the Triple.equals(Object) method for each Triple.

      The behaviour of the Stream is not specified if Graph.add(Triple), Graph.remove(Triple) or Graph.clear() are called on the Graph before it terminates.

      Implementations may throw ConcurrentModificationException from Stream methods if they detect a conflict while the Stream is active.

      Specified by:
      stream in interface Graph
      Parameters:
      subject - The triple subject (null is a wildcard)
      predicate - The triple predicate (null is a wildcard)
      object - The triple object (null is a wildcard)
      Returns:
      A Stream over the matched triples.
    • stream

      public Stream<? extends Triple> stream()
      Description copied from interface: GraphLike
      Return a Stream of contained statements.
      Specified by:
      stream in interface Graph
      Specified by:
      stream in interface GraphLike<Triple>
      Overrides:
      stream in class AbstractJsonLdGraphLike<Triple>
      Returns:
      A Stream of TripleLike statements.
    • asTripleOrQuad

      JsonLdTriple asTripleOrQuad(com.github.jsonldjava.core.RDFDataset.Quad jsonldQuad)
      Description copied from class: AbstractJsonLdGraphLike
      Convert JsonLd Quad to a Commons RDF Triple or Quad
      Specified by:
      asTripleOrQuad in class AbstractJsonLdGraphLike<Triple>
      Parameters:
      jsonldQuad - jsonld quad to convert
      Returns:
      converted TripleLike
      See Also:
    • size

      public long size()
      Description copied from interface: GraphLike
      Number of statements.
      Specified by:
      size in interface Graph
      Specified by:
      size in interface GraphLike<Triple>
      Returns:
      Number of statements