query.where(QNODE.s.in(ids)); CloseableIterator<STMT> stmts = query.construct(Blocks.SPOC); Map<ID, Multimap<UID, STMT>> directProps = getPropertiesMap(stmts, false);
@Test(expected = IllegalArgumentException.class) @Ignore public void In_Empty_Is_Not_Allowed() { QNODE.s.in(); }
query.where(QNODE.s.in(ids));
private Block handleRootPath(Path<?> path, Filters filters) { MappedClass mappedClass = configuration.getMappedClass(path.getType()); UID rdfType = mappedClass.getUID(); UID context = mappedClass.getContext(); QID pathNode = new QID(path.toString()); pathToMapped.put(path, pathNode); if (rdfType != null) { Collection<UID> types = ontology.getSubtypes(rdfType); if (types.size() > 1 && inferenceOptions.subClassOf()) { QID type = new QID(path + "_type"); filters.add(type.in(types)); return Blocks.pattern(pathNode, RDF.type, type); } else { if (context != null) { pathToContext.put(path, context); return Blocks.pattern(pathNode, RDF.type, rdfType, context); } else { return Blocks.pattern(pathNode, RDF.type, rdfType); } } } else { throw new IllegalArgumentException("No types mapped against " + path.getType().getName()); } }
private RDFQuery createQuery(MappedClass mappedClass, @Nullable UID type, boolean polymorphic) { RDFQuery query = new RDFQueryImpl(connection); if (type != null) { query.where(Blocks.S_TYPE); if (mappedClass.getContext() != null) { query.set(QNODE.typeContext, mappedClass.getContext()); } if (polymorphic) { Collection<UID> types = ontology.getSubtypes(type); if (types.size() > 1 && connection.getInferenceOptions().subClassOf()) { query.where(QNODE.type.in(types)); } else { query.set(QNODE.type, type); } } else { query.set(QNODE.type, type); } } query.where(Blocks.SPOC); if (!polymorphic && mappedClass.getDynamicProperties().isEmpty() && mappedClass.getMappedPredicates().size() < 5) { query.where(QNODE.p.in(mappedClass.getMappedPredicates())); } return query; }
@Test @Ignore public void In_Objects() { Predicate p = QNODE.s.in(RDF.first, RDF.rest); assertEquals(QNODE.s.eq(RDF.first).or(QNODE.s.eq(RDF.rest)), p); }