@Override public ExtendedIterator<Resource> filterDrop( final Predicate<Resource> f ) { return iter.filterDrop(f); }
/** Answer an iterator over the elements of <code>i</code> that are not in the graph <code>seen</code>. */ public static ExtendedIterator<Triple> rejecting( final ExtendedIterator<Triple> i, final Graph seen ) { return i.filterDrop( seen::contains ); }
@Override public ExtendedIterator<Statement> filterDrop( final Predicate<Statement> f ) { return iter.filterDrop(f); }
@Override public ExtendedIterator<RDFNode> filterDrop( final Predicate<RDFNode> f ) { return iter.filterDrop(f); }
@Override public ExtendedIterator<ReifiedStatement> filterDrop( final Predicate<ReifiedStatement> f ) { return iter.filterDrop(f); }
/** Answer an iterator over the elements of <code>i</code> that are not in the graph <code>seen</code>. */ public static ExtendedIterator<Triple> rejecting( final ExtendedIterator<Triple> i, final Graph seen ) { return i.filterDrop( seen::contains ); }
/** * <p> * Answer an iterator over the elements of iterator i that are not in the set <code>seen</code>. * </p> * * @param i An extended iterator * @param seen A set of objects * @return An iterator over the elements of i that are not in the set <code>seen</code>. */ public static ExtendedIterator<Triple> rejecting( final ExtendedIterator<Triple> i, final Set<Triple> seen ) { return i.filterDrop( seen::contains ); }
/** * <p> * Answer an iterator over the elements of iterator i that are not in the set <code>seen</code>. * </p> * * @param i An extended iterator * @param seen A set of objects * @return An iterator over the elements of i that are not in the set <code>seen</code>. */ public static ExtendedIterator<Triple> rejecting( final ExtendedIterator<Triple> i, final Set<Triple> seen ) { return i.filterDrop( seen::contains ); }
private static ExtendedIterator<RDFNode> rejecting(ExtendedIterator<RDFNode> i, Set<RDFNode> seen) { return i.filterDrop(seen::contains); }
/** * <p> * Answer an iterator that ranges over the named class-descriptions * in this model, i.e. resources with <code>rdf:type * Class</code> (or equivalent) and a node URI. * </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 named class resources. */ @Override public ExtendedIterator<OntClass> listNamedClasses() { return listClasses().filterDrop( OntClass::isAnon ); }
@Override public ExtendedIterator<Triple> _graphBaseFind( Triple t ) { return L.find( t ). filterDrop ( ifIn( R ) ); } }
@Override public ExtendedIterator<Triple> _graphBaseFind( Triple t ) { return L.find( t ). filterDrop ( ifIn( R ) ); } }
@Override public ExtendedIterator<RDFNode> eval(RDFNode focusNode, NodeExpressionContext context) { Set<RDFNode> sans = minus.eval(focusNode, context).toSet(); return getInput().eval(focusNode, context).filterDrop(n -> sans.contains(n)); }
protected Set<OWLClass> getAllClasses() { if(ks.isRemote()){ return new SPARQLTasks(ks.getEndpoint()).getAllClasses(); } else { return ((LocalModelBasedSparqlEndpointKS) ks).getModel().listClasses() .filterDrop(new OWLFilter()) .filterDrop(new RDFSFilter()) .filterDrop(new RDFFilter()) .toList().stream() .filter(cls -> !cls.isAnon()) .map(cls -> df.getOWLClass(IRI.create(cls.getURI()))) .collect(Collectors.toCollection(TreeSet::new)); } }
/** * <p>Answer an iterator over all of the properties that are declared to be super-properties of * this property. Each element of the iterator will be an {@link OntProperty}.</p> * @param direct If true, only answer the directly adjacent properties in the * property hierarchy: i.e. eliminate any property for which there is a longer route * to reach that child under the super-property relation. * @return An iterator over the super-properties of this property. * @exception ProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile. */ @Override public ExtendedIterator<OntProperty> listSuperProperties( boolean direct ) { // Eclispe Oxygen (July 2017) generates a warning on use of "this::equals" in filterDrop. OntProperty op = this; return listDirectPropertyValues( getProfile().SUB_PROPERTY_OF(), "SUB_PROPERTY_OF", OntProperty.class, getProfile().SUB_PROPERTY_OF(), direct, false ) .filterDrop(op::equals); }
/** * Find all the base triples matching tm, exclude the ones that are deleted, * add the ones that have been added. */ @Override protected ExtendedIterator<Triple> graphBaseFind(Triple t) { ExtendedIterator<Triple> iterator = base.find(t).filterDrop(ifIn(GraphUtil.findAll(deletions))).andThen(additions.find(t)) ; return SimpleEventManager.notifyingRemove( this, iterator ) ; }
/** * Find all the base triples matching tm, exclude the ones that are deleted, * add the ones that have been added. */ @Override protected ExtendedIterator<Triple> graphBaseFind(Triple t) { ExtendedIterator<Triple> iterator = base.find(t).filterDrop(ifIn(GraphUtil.findAll(deletions))).andThen(additions.find(t)) ; return SimpleEventManager.notifyingRemove( this, iterator ) ; }
@Override public ExtendedIterator<Triple> find( Node s, Node p, Node o ) { return SimpleEventManager.notifyingRemove( this, base.find( s, p, o ).filterDrop( t -> t.getSubject().isLiteral() || t.getPredicate().isBlank() || t.getPredicate().isLiteral() ) ); }
@Override public ExtendedIterator<Triple> find( Node s, Node p, Node o ) { return SimpleEventManager.notifyingRemove( this, base.find( s, p, o ).filterDrop( t -> t.getSubject().isLiteral() || t.getPredicate().isBlank() || t.getPredicate().isLiteral() ) ); }
@Test public void testVocabularyRev() { final Graph graph = getVocabulary(namespace()); final Set<String> subjects = fields().map(namespace()::concat).collect(toSet()); assertTrue(subjects.size() > 0, "Unable to extract field definitions!"); graph.find(ANY, ANY, ANY).mapWith(Triple::getSubject).filterKeep(Node::isURI).mapWith(Node::getURI) .filterKeep(Objects::nonNull) .filterKeep(uri -> uri.startsWith(namespace())).filterDrop(namespace()::equals) .filterDrop(subjects::contains).forEachRemaining(uri -> { LOGGER.debug("{} not defined in {} class", uri, vocabulary().getName()); }); }