Package org.apache.jena.rdf.model.impl
Class ModelReifier
- java.lang.Object
-
- org.apache.jena.rdf.model.impl.ModelReifier
-
public class ModelReifier extends java.lang.Object
This class impedance-matches the reification requests of Model[Com] to the operations supplied by it's Graph's Reifier.
-
-
Constructor Summary
Constructors Constructor Description ModelReifier(ModelCom model)
establish the internal state of this ModelReifier: the associated Model[Com] and its graph's Reifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReifiedStatement
createReifiedStatement(java.lang.String uri, Statement s)
Answer a reification of a statement with a given uri.ReifiedStatement
createReifiedStatement(Statement s)
Answer a fresh reification of a statement associated with a fresh bnode.Resource
getAnyReifiedStatement(Statement s)
Find any existing reified statement that reifies a givem statement.boolean
isReified(FrontsTriple s)
Answer true iff a given statement is reified in this modelRSIterator
listReifiedStatements()
Answer an iterator that iterates over all the reified statements in this model.RSIterator
listReifiedStatements(FrontsTriple s)
Answer an iterator that iterates over all the reified statements in this model that reify a given statement.void
noteIfReified(RDFNode s, RDFNode p, RDFNode o)
the triple (s, p, o) has been asserted into the model.void
removeAllReifications(FrontsTriple s)
Remove all the reifications of a given statement in this model, whatever their associated resources.void
removeReification(ReifiedStatement rs)
Remove a given reification from this model.
-
-
-
Constructor Detail
-
ModelReifier
public ModelReifier(ModelCom model)
establish the internal state of this ModelReifier: the associated Model[Com] and its graph's Reifier.
-
-
Method Detail
-
createReifiedStatement
public ReifiedStatement createReifiedStatement(Statement s)
Answer a fresh reification of a statement associated with a fresh bnode.- Parameters:
s
- a Statement to reifiy- Returns:
- a reified statement object who's name is a new bnode
-
createReifiedStatement
public ReifiedStatement createReifiedStatement(java.lang.String uri, Statement s)
Answer a reification of a statement with a given uri. If that uri already reifies a distinct Statement, throw an AlreadyReifiedException.- Parameters:
uri
- the URI of the resource which will reifys
s
- the Statement to reify- Returns:
- a reified statement object associating
uri
withs
. - Throws:
AlreadyReifiedException
- if uri already reifies something else.
-
getAnyReifiedStatement
public Resource getAnyReifiedStatement(Statement s)
Find any existing reified statement that reifies a givem statement. If there isn't one, create one.- Parameters:
s
- a Statement for which to find [or create] a reification- Returns:
- a reification for s, re-using an existing one if possible
-
isReified
public boolean isReified(FrontsTriple s)
Answer true iff a given statement is reified in this model- Parameters:
s
- the statement for which a reification is sought- Returns:
- true iff s has a reification in this model
-
removeAllReifications
public void removeAllReifications(FrontsTriple s)
Remove all the reifications of a given statement in this model, whatever their associated resources.- Parameters:
s
- the statement whose reifications are to be removed
-
removeReification
public void removeReification(ReifiedStatement rs)
Remove a given reification from this model. Other reifications of the same statement are untouched.- Parameters:
rs
- the reified statement to be removed
-
listReifiedStatements
public RSIterator listReifiedStatements()
Answer an iterator that iterates over all the reified statements in this model.- Returns:
- an iterator over all the reifications of the model.
-
listReifiedStatements
public RSIterator listReifiedStatements(FrontsTriple s)
Answer an iterator that iterates over all the reified statements in this model that reify a given statement.- Parameters:
s
- the statement whose reifications are sought.- Returns:
- an iterator over the reifications of s.
-
-