/** Answer true iff this triple can be compared for sameValueAs by .equals(), ie, it is a concrete triple with a non-literal object. */ protected final boolean isSafeForEquality( Triple t ) { return t.isConcrete() && !t.getObject().isLiteral(); } }
/** Answer true iff this graph contains <code>t</code>. If <code>t</code> happens to be concrete, then we hand responsibility over to the store. Otherwise we use the default implementation. */ @Override public boolean graphBaseContains( Triple t ) { return t.isConcrete() ? store.contains( t ) : super.graphBaseContains( t ); }
@Override public Iterator<Triple> convert(final Binding b) { // Iteration is a new mapping of bnodes. bNodeMap.clear() ; List<Triple> tripleList = new ArrayList<Triple>(triples.size()); for (Triple triple : triples) { Triple q = subst(triple, b, bNodeMap) ; if ( ! q.isConcrete() || ! ModelUtils.isValidAsStatement(q.getSubject(), q.getPredicate(), q.getObject()) ) { //Log.warn(TemplateLib.class, "Unbound quad: "+FmtUtils.stringForQuad(quad)) ; continue ; } tripleList.add(q); } return tripleList.iterator(); } });
@Override public boolean graphBaseContains( Triple t ) { if ( t.isConcrete() ) return triples.contains( t ) ; ClosableIterator<Triple> it = find( t ); try { for ( ; it.hasNext() ; ) { Triple t2 = it.next() ; if ( tripleContained(t, t2) ) return true ; } } finally { it.close(); } return false ; }
public Graph explain(Triple pattern) { if( !pattern.equals( INCONCISTENCY_TRIPLE ) ) { if( !pattern.isConcrete() ) { if( log.isLoggable( Level.WARNING ) ) { log.warning( "Triple patterns with variables cannot be epxlained: " + pattern );
@Override public boolean graphBaseContains( Triple t ) { if ( t.isConcrete() ) return triples.contains( t ) ; ClosableIterator<Triple> it = find( t ); try { for ( ; it.hasNext() ; ) { Triple t2 = it.next() ; if ( tripleContained(t, t2) ) return true ; } } finally { it.close(); } return false ; }