/** * Tries to return the items of a list or empty if th elist is empty or not an rdf:List */ public static Collection<RDFNode> getListItemsOrEmpty(RDFNode node) { ImmutableList.Builder<RDFNode> items = ImmutableList.builder(); if (isList(node)) { RDFList rdfList = node.as(RDFList.class); rdfList.iterator().forEachRemaining(items::add); } return items.build(); }
/** * Tries to return the items of a list or empty if th elist is empty or not an rdf:List */ public static Collection<RDFNode> getListItemsOrEmpty(RDFNode node) { ImmutableList.Builder<RDFNode> items = ImmutableList.builder(); if (isList(node)) { RDFList rdfList = node.as(RDFList.class); rdfList.iterator().forEachRemaining(items::add); } return items.build(); }
/** * <p>Answer an iterator over all of the classes that are the operands of this * Boolean class expression. Each element of the iterator will be an {@link OntClass}.</p> * @return An iterator over the operands of the expression. * @exception ProfileException If the operand property is not supported in the current language profile. */ @Override public ExtendedIterator<? extends OntClass> listOperands() { return getOperands().iterator().mapWith( n -> n.as( OntClass.class ) ); }
/** * <p>Answer an iterator over all of the classes that are the operands of this * Boolean class expression. Each element of the iterator will be an {@link OntClass}.</p> * @return An iterator over the operands of the expression. * @exception ProfileException If the operand property is not supported in the current language profile. */ @Override public ExtendedIterator<? extends OntClass> listOperands() { return getOperands().iterator().mapWith( n -> n.as( OntClass.class ) ); }
/** * <p>Answer an iterator over all of the literals that are declared to be the permissible values for * this class. Each element of the iterator will be an {@link Literal}.</p> * @return An iterator over the literals that are the permissible values * @exception ProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile. */ @Override public ExtendedIterator<Literal> listOneOf() { return getOneOf().iterator().mapWith( n -> n.as( Literal.class ) ); }
/** * <p>Answer an iterator over all of the individuals that are declared to be the class extension for * this class. Each element of the iterator will be an {@link OntResource}.</p> * @return An iterator over the individuals in the class extension * @exception ProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile. */ @Override public ExtendedIterator<? extends OntResource> listOneOf() { return getOneOf().iterator().mapWith( n -> n.as( OntResource.class ) ); }
/** * <p>Answer an iterator over all of the literals that are declared to be the permissible values for * this class. Each element of the iterator will be an {@link Literal}.</p> * @return An iterator over the literals that are the permissible values * @exception ProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile. */ @Override public ExtendedIterator<Literal> listOneOf() { return getOneOf().iterator().mapWith( n -> n.as( Literal.class ) ); }
/** * <p>Answer an iterator over all of the individuals that are declared to be the class extension for * this class. Each element of the iterator will be an {@link OntResource}.</p> * @return An iterator over the individuals in the class extension * @exception ProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile. */ @Override public ExtendedIterator<? extends OntResource> listOneOf() { return getOneOf().iterator().mapWith( n -> n.as( OntResource.class ) ); }
for(RDFNode entry : entries.as(RDFList.class).iterator().toList()) { items.add(new Item(entry.asResource(), filePath, manifestFile));
for(RDFNode entry : entries.as(RDFList.class).iterator().toList()) { items.add(new Item(entry.asResource(), filePath, manifestFile));
private <E> Collection<E> parseIntoCollection(RDFList list, Collection<E> l, ClassMeta<?> type, BeanPropertyMeta pMeta) throws Exception { int argIndex = 0; for (ExtendedIterator<RDFNode> ni = list.iterator(); ni.hasNext();) { E e = (E)parseAnything(type.isArgs() ? type.getArg(argIndex++) : type.getElementType(), ni.next(), l, pMeta); l.add(e); } return l; }
Iterator<RDFNode> members = resource.as(RDFList.class).iterator(); while(members.hasNext()) { RDFNode member = members.next();
Iterator<RDFNode> members = resource.as(RDFList.class).iterator(); while(members.hasNext()) { RDFNode member = members.next();
private static void appendPathBlankNode(StringBuffer sb, Resource path, String separator) { if(path.hasProperty(RDF.first)) { Iterator<RDFNode> it = path.as(RDFList.class).iterator(); while(it.hasNext()) { Resource item = (Resource) it.next();
private static void appendPathBlankNode(StringBuffer sb, Resource path, String separator) { if(path.hasProperty(RDF.first)) { Iterator<RDFNode> it = path.as(RDFList.class).iterator(); while(it.hasNext()) { Resource item = (Resource) it.next();
/** Format:: access:entry [ :user "user2" ; :graphs (<http://host/graphname3> ) ] */ private void parseStruct(Multimap<String, Node> map, Resource root, Resource r) { if ( ! GraphUtils.exactlyOneProperty(r, VocabSecurity.pUser) ) throw new AssemblerException(root, "Expected exactly one access:user property for "+r); if ( ! GraphUtils.exactlyOneProperty(r, VocabSecurity.pGraphs) ) throw new AssemblerException(root, "Expected exactly one access:graphs property for "+r); String user = GraphUtils.getStringValue(r, VocabSecurity.pUser); r.listProperties(VocabSecurity.pGraphs).mapWith(s->s.getObject()).forEachRemaining(x->{ List<Node> graphs = new ArrayList<>(); if ( x.isURIResource() ) { //System.out.printf("S: user %s : access : %s\n", user, x.asNode()); graphs.add(x.asNode()); } else { // List? RDFList list = x.as(RDFList.class); list.iterator().forEachRemaining(rn->{ graphs.add(rn.asNode()); }); } accessEntries(root, map, user, graphs); }); }
@Override public boolean sameListAs(final RDFList list) throws ReadDeniedException, AuthenticationRequiredException { checkRead(); ExtendedIterator<RDFNode> thisIter = null; ExtendedIterator<RDFNode> thatIter = null; try { thisIter = iterator(); thatIter = list.iterator(); while (thisIter.hasNext() && thatIter.hasNext()) { final RDFNode thisN = thisIter.next(); final RDFNode thatN = thatIter.next(); if ((thisN == null) || !thisN.equals(thatN)) { // not equal at this position return false; } } return !(thisIter.hasNext() || thatIter.hasNext()); } finally { if (thisIter != null) { thisIter.close(); } if (thatIter != null) { thatIter.close(); } } }
List<NodeExpression> args = new LinkedList<>(); RDFList list = s.getResource().as(RDFList.class); for(RDFNode member : list.iterator().toList()) { args.add(create(member));
List<NodeExpression> inputs = new LinkedList<NodeExpression>(); RDFList list = union.as(RDFList.class); for(RDFNode member : list.iterator().toList()) { inputs.add(create(member)); List<NodeExpression> inputs = new LinkedList<NodeExpression>(); RDFList list = intersection.as(RDFList.class); for(RDFNode member : list.iterator().toList()) { inputs.add(create(member)); List<NodeExpression> args = new LinkedList<>(); RDFList list = s.getResource().as(RDFList.class); for(RDFNode member : list.iterator().toList()) { args.add(create(member));
@Override public void concatenate(final RDFList list) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException { checkUpdate(); if (holder.getBaseItem().isEmpty()) { // concatenating list onto the empty list is an error throw new EmptyListUpdateException( "Tried to concatenate onto the empty list"); } else { Triple t = new Triple(SecurityEvaluator.FUTURE, listFirst() .asNode(), Node.ANY); if (!canCreate(t)) { final ExtendedIterator<RDFNode> iter = list.iterator(); try { while (iter.hasNext()) { t = new Triple(SecurityEvaluator.FUTURE, listFirst() .asNode(), iter.next().asNode()); checkCreate(t); } } finally { iter.close(); } } holder.getBaseItem().concatenate(list); } }