/** * An iterator over no elements. * @return A class singleton which doesn't iterate. */ static public <T> ExtendedIterator<T> emptyIterator() { return NullIterator.instance() ; }
public static <T> NullIterator<T> instance() { return new NullIterator<T>(); }
@Override protected ExtendedIterator<Triple> graphBaseFind(TripleMatch m) { return NullIterator.instance(); } };
/** * Answer an iterator over all of the values for the given key. An iterator * is always supplied, even if the key is not present. * * @param key The key object * @return An iterator over all of the values for this key in the map */ public Iterator<To> getAll( Object key ) { List<To> entry = m_table.get( key ); return (entry != null) ? entry.iterator() : new NullIterator<To>(); }
@Override protected ExtendedIterator<Triple> graphBaseFind( TripleMatch m ) { return NullIterator.instance(); } };
/** * Return the derivation of at triple. * The derivation is a List of DerivationRecords */ @Override public Iterator<Derivation> getDerivation(Triple t) { if (derivations == null) { return new NullIterator<Derivation>(); } else { return derivations.getAll(t); } }
@Override protected ExtendedIterator<Triple> graphBaseFind(TripleMatch m) { return NullIterator.instance() ; }
/** * Return the derivation of at triple. * The derivation is a List of DerivationRecords */ @Override public Iterator<Derivation> getDerivation(Triple t) { if (derivations == null) { return new NullIterator<Derivation>(); } else { return derivations.getAll(t); } }
@Override protected ExtendedIterator<Triple> graphBaseFind(TripleMatch m) { return NullIterator.instance() ; }
/** * Basic pattern lookup interface. * @param pattern a TriplePattern to be matched against the data * @return a ClosableIterator over all Triples in the data set * that match the pattern */ @Override public ExtendedIterator<Triple> find(TriplePattern pattern) { if (graph == null) return new NullIterator<Triple>(); return graph.find(pattern.asTripleMatch()); }
/** Answer an iterator over the reification triples of this Reifier, or an empty iterator - if showHidden is false, only the exposed triples, otherwise only the concealed ones. */ public static ExtendedIterator<Triple> findEither(Graph graph, TripleMatch match, boolean showHidden) { if ( showHidden ) return NullIterator.instance() ; else return graph.find(match) ; }
@Override public ExtendedIterator<Triple> graphBaseFind(final Triple pattern) { try { return WrappedIterator.createNoRemove(query(pattern)); } catch (final SyntaxError exception) { logger().error(MessageCatalog._00113_NWS_FAILURE, exception); return new NullIterator<Triple>(); } }
public ExtendedIterator<Triple> findEither(TripleMatch match, boolean showHidden) { if ( showHidden ) return NullIterator.instance() ; else return graph.find(match) ; }
/** * Extended find interface used in situations where the implementator * may or may not be able to answer the complete query. It will * attempt to answer the pattern but if its answers are not known * to be complete then it will also pass the request on to the nested * Finder to append more results. * @param pattern a TriplePattern to be matched against the data * @param continuation either a Finder or a normal Graph which * will be asked for additional match results if the implementor * may not have completely satisfied the query. */ @Override public ExtendedIterator<Triple> findWithContinuation(TriplePattern pattern, Finder continuation) { if (graph == null) return new NullIterator<Triple>(); if (continuation == null) { return graph.find(pattern.asTripleMatch()); } else { return graph.find(pattern.asTripleMatch()).andThen(continuation.find(pattern)); } }
/** Given an Iterator that returns Iterator's, this creates an * Iterator over the next level values. * Similar to list splicing in lisp. */ public static <T> ExtendedIterator<T> createIteratorIterator( Iterator<Iterator<T>> it ) { ExtendedIterator<T> retval = NullIterator.instance(); while (it.hasNext()) { retval = retval.andThen(it.next()); } return retval; }
/** * <p> * Answer an iterator that ranges over the properties in this model that are declared * to be annotation properties. Not all supported languages define annotation properties * (the category of annotation properties is chiefly an OWL innovation). * </p> * <p> * <strong>Note:</strong> the number of nodes returned by this iterator will vary according to * the completeness of the deductive extension of the underlying graph. See class * overview for more details. * </p> * * @return An iterator over annotation properties. * @see Profile#getAnnotationProperties() */ @Override public ExtendedIterator<AnnotationProperty> listAnnotationProperties() { checkProfileEntry( getProfile().ANNOTATION_PROPERTY(), "ANNOTATION_PROPERTY" ); Resource r = getProfile().ANNOTATION_PROPERTY(); if (r == null) { return new NullIterator<AnnotationProperty>(); } else { return findByType( r ) .mapWith( new SubjectNodeAs<AnnotationProperty>( AnnotationProperty.class ) ) .filterKeep( new UniqueFilter<AnnotationProperty>()); } }
@Override public ExtendedIterator<Triple> iterator( Object o, HashCommon.NotifyEmpty container ) { TripleBunch b = bunchMap.get( o ); return b == null ? NullIterator.<Triple>instance() : b.iterator(); }
/** Answer an iterator over all the triples in this NTM which have index node <code>o</code>. */ @Override public Iterator<Triple> iterator( Object o, HashCommon.NotifyEmpty container ) { // System.err.println( ">> BOINK" ); // if (true) throw new JenaException( "BOINK" ); TripleBunch s = bunchMap.get( o ); return s == null ? NullIterator.<Triple>instance() : s.iterator( container ); }
/** * {@inheritDoc} */ @Override protected ExtendedIterator<Triple> graphBaseFind(TripleMatch m) { ExtendedIterator<Triple> result = NullIterator.instance(); for (final Graph g : m_subGraphs) { result = result.andThen(g.find(m)); } return result; }
public static ExtendedIterator<Triple> findTriple(KnowledgeBase kb, PelletInfGraph pellet, Node subj, Node pred, Node obj) { Node s = normalize( subj ); Node p = normalize( pred ); Node o = normalize( obj ); if( p == VAR && o != VAR && o != CONST ) { pred = p = RDF.type.asNode(); } TripleQueryHandler qh = QUERY_HANDLERS.get( Triple.create( s, p, o ) ); if( qh == null ) { if( log.isLoggable( Level.WARNING ) ) log.warning( "No query handler found for " + subj + " " + pred + " " + obj ); } return qh == null ? NullIterator.<Triple>instance() : qh.find( kb, pellet, subj, pred, obj ); }