Class JsonLdGraphImpl

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

class JsonLdGraphImpl extends AbstractJsonLdGraphLike<Triple> implements JsonLdGraph
  • Field Details

  • Constructor Details

    • JsonLdGraphImpl

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

      JsonLdGraphImpl(com.github.jsonldjava.core.RDFDataset rdfDataSet, Optional<BlankNodeOrIRI> graphName, String bnodePrefix)
    • JsonLdGraphImpl

      JsonLdGraphImpl(String bnodePrefix)
  • Method Details

    • clear

      public void clear()
      Description copied from interface: GraphLike
      Remove all statements.
      Specified by:
      clear in interface Graph
      Specified by:
      clear in interface GraphLike<Triple>
      Overrides:
      clear in class AbstractJsonLdGraphLike<Triple>
    • add

      public void add(Triple t)
      Description copied from interface: GraphLike
      Add a statement.
      Specified by:
      add in interface Graph
      Specified by:
      add in interface GraphLike<Triple>
      Overrides:
      add in class AbstractJsonLdGraphLike<Triple>
      Parameters:
      t - The TripleLike statement to add
    • 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.
    • contains

      public boolean contains(Triple t)
      Description copied from interface: GraphLike
      Check if statement is contained.
      Specified by:
      contains in interface Graph
      Specified by:
      contains in interface GraphLike<Triple>
      Overrides:
      contains in class AbstractJsonLdGraphLike<Triple>
      Parameters:
      t - The TripleLike statement to check
      Returns:
      True if the statement is contained
    • 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
    • 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
    • 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.
    • 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: