Class ModelReifier

java.lang.Object
org.apache.jena.rdf.model.impl.ModelReifier

public class ModelReifier extends Object
This class impedance-matches the reification requests of Model[Com] to the operations supplied by it's Graph's Reifier.
  • Constructor Details

    • ModelReifier

      public ModelReifier(ModelCom model)
      establish the internal state of this ModelReifier: the associated Model[Com] and its graph's Reifier.
  • Method Details

    • 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(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 reify s
      s - the Statement to reify
      Returns:
      a reified statement object associating uri with s.
      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.
    • noteIfReified

      public void noteIfReified(RDFNode s, RDFNode p, RDFNode o)
      the triple (s, p, o) has been asserted into the model. Any reified statements among them need to be added to this model.