Class JsonLdGraphImpl

    • Field Detail

      • graphName

        private final java.util.Optional<BlankNodeOrIRI> graphName
    • Constructor Detail

      • JsonLdGraphImpl

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

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

        JsonLdGraphImpl​(java.lang.String bnodePrefix)
    • Method Detail

      • 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
      • 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 java.util.stream.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.