Package org.apache.commons.rdfrdf4j
Interface RDF4JGraphLike<T extends org.apache.commons.rdf.api.TripleLike>
- All Superinterfaces:
AutoCloseable
,org.apache.commons.rdf.api.GraphLike<T>
- All Known Subinterfaces:
RDF4JDataset
,RDF4JGraph
public interface RDF4JGraphLike<T extends org.apache.commons.rdf.api.TripleLike>
extends org.apache.commons.rdf.api.GraphLike<T>, AutoCloseable
Marker interface for RDF4J implementations of GraphLike.
This is a common interface for RDF4JGraph
and RDF4JDataset
which provides access to the underlying RDF4J Model
and/or
Repository
.
At least one of asModel()
or asRepository()
will always be
Optional.isPresent()
.
- See Also:
-
Method Summary
Methods inherited from interface java.lang.AutoCloseable
close
Methods inherited from interface org.apache.commons.rdf.api.GraphLike
add, clear, contains, iterate, remove, size, stream
-
Method Details
-
asModel
Optional<org.eclipse.rdf4j.model.Model> asModel()Return the corresponding RDF4JModel
, if present.The return value is
Optional.isPresent()
if this is backed by a Model.Changes to the Model are reflected in both directions.
- Returns:
- The corresponding RDF4J Model.
-
asRepository
Optional<org.eclipse.rdf4j.repository.Repository> asRepository()Return the corresponding RDF4JRepository
, if present.The return value is
Optional.isPresent()
if this is backed by a Repository.Changes to the Repository are reflected in both directions.
- Returns:
- The corresponding RDF4J Repository.
-