Class 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.
      s - a Statement to reifiy
      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.
      uri - the URI of the resource which will reify s
      s - the Statement to reify
      a reified statement object associating uri with s.
      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.
      s - a Statement for which to find [or create] a reification
      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
      s - the statement for which a reification is sought
      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.
      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.
      rs - the reified statement to be removed
    • listReifiedStatements

      public RSIterator listReifiedStatements()
      Answer an iterator that iterates over all the reified statements in this model.
      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.
      s - the statement whose reifications are sought.
      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.