/** create a ReifiedStatement corresponding to this Statement */ @Override public ReifiedStatement createReifiedStatement() { return ReifiedStatementImpl.create( this ); }
/** factory method. answer a ReifiedStatement which encodes the Statement _s_ with uri _uri_. The mapping is remembered. */ public static ReifiedStatementImpl create( ModelCom m, String uri, Statement s ) { return new ReifiedStatementImpl( m, uri, s ).installInReifier(); }
protected ReifiedStatementImpl( EnhGraph m, Node n, Statement s ) { super( n, m ); assertStatement( s ); }
/** convert a _node_ into a ReifiedStatement in the enhanced graph _eg_ by looking into this graph's reifier to find the binding for the node; throw a DoesNotReify exception if there's no mapping. */ @Override public EnhNode wrap( Node n, EnhGraph eg ) { Triple x = getTriple( eg, n ); if (x == null) throw new DoesNotReifyException( n ); Statement st = StatementImpl.toStatement( x, (ModelCom) eg ); return new ReifiedStatementImpl( eg, n, st ); }
/** Answer a ReifiedStatement that is based on the given node. @param n the node which represents the reification (and is bound to some triple t) @return a ReifiedStatement associating the resource of n with the statement of t. */ private ReifiedStatement getRS( Node n ) { return ReifiedStatementImpl.createExistingReifiedStatement( model, n ); } }
public static ReifiedStatement createExistingReifiedStatement( ModelCom model, Node n ) { Triple t = ReifierStd.getTriple(model.getGraph(), n ); return new ReifiedStatementImpl( model, n, model.asStatement( t ) ); } }
/** Answer a ReifiedStatement that is based on the given node. @param n the node which represents the reification (and is bound to some triple t) @return a ReifiedStatement associating the resource of n with the statement of t. */ private ReifiedStatement getRS( Node n ) { return ReifiedStatementImpl.createExistingReifiedStatement( model, n ); } }
/** Answer a reification of a statement with a given uri. If that uri already reifies a distinct Statement, throw an AlreadyReifiedException. @param uri the URI of the resource which will reify <code>s</code> @param s the Statement to reify @return a reified statement object associating <code>uri</code> with <code>s</code>. @throws AlreadyReifiedException if uri already reifies something else. */ public ReifiedStatement createReifiedStatement( String uri, Statement s ) { return ReifiedStatementImpl.create( model, uri, s ); }
/** tell the underlying graph's reifier that this ReifiedStatement's node represents any Statement with this statement's triple. (May throw an exception if the node is already reified to something different.) */ private ReifiedStatementImpl installInReifier() { ReifierStd.reifyAs(getModel().getGraph(), this.asNode(), statement.asTriple() ); return this; }
/** factory method. answer a ReifiedStatement which encodes the Statement _s_ with uri _uri_. The mapping is remembered. */ public static ReifiedStatementImpl create( ModelCom m, String uri, Statement s ) { return new ReifiedStatementImpl( m, uri, s ).installInReifier(); }
protected ReifiedStatementImpl( EnhGraph m, Node n, Statement s ) { super( n, m ); assertStatement( s ); }
public static ReifiedStatement createExistingReifiedStatement( ModelCom model, Node n ) { Triple t = ReifierStd.getTriple(model.getGraph(), n ); return new ReifiedStatementImpl( model, n, model.asStatement( t ) ); } }
/** create a ReifiedStatement corresponding to this Statement */ @Override public ReifiedStatement createReifiedStatement() { return ReifiedStatementImpl.create( this ); }
/** tell the underlying graph's reifier that this ReifiedStatement's node represents any Statement with this statement's triple. (May throw an exception if the node is already reified to something different.) */ private ReifiedStatementImpl installInReifier() { ReifierStd.reifyAs(getModel().getGraph(), this.asNode(), statement.asTriple() ); return this; }
public static ReifiedStatementImpl create( EnhGraph eg, Node n, Statement s ) { return new ReifiedStatementImpl( eg, n, s ).installInReifier(); }
/** private constructor, relies (ugh) on super(uri, model) generating bnode if uril == null. */ private ReifiedStatementImpl( ModelCom m, String uri, Statement s ) { super( uri, m ); assertStatement( s ); }
/** convert a _node_ into a ReifiedStatement in the enhanced graph _eg_ by looking into this graph's reifier to find the binding for the node; throw a DoesNotReify exception if there's no mapping. */ @Override public EnhNode wrap( Node n, EnhGraph eg ) { Triple x = getTriple( eg, n ); if (x == null) throw new DoesNotReifyException( n ); Statement st = StatementImpl.toStatement( x, (ModelCom) eg ); return new ReifiedStatementImpl( eg, n, st ); }
/** Answer a reification of a statement with a given uri. If that uri already reifies a distinct Statement, throw an AlreadyReifiedException. @param uri the URI of the resource which will reify <code>s</code> @param s the Statement to reify @return a reified statement object associating <code>uri</code> with <code>s</code>. @throws AlreadyReifiedException if uri already reifies something else. */ public ReifiedStatement createReifiedStatement( String uri, Statement s ) { return ReifiedStatementImpl.create( model, uri, s ); }