private static void addIntersections(Model result, Model schema, Statement s) { Resource type = s.getSubject(); List<RDFNode> types = asJavaList(AssemblerHelp.getResource(s)); Set<Resource> candidates = subjectSet(result, ANY, RDF.type, types.get(0)); for (int i = 1; i < types.size(); i += 1) removeElementsWithoutType(candidates, (Resource) types.get(i)); addTypeToAll(type, candidates); }
private static void addTypeToAll(Resource type, Set<Resource> candidates) { List<Resource> types = equivalentTypes(type); for (Resource element : candidates) { Resource resource = element; for (int i = 0; i < types.size(); i += 1) resource.addProperty(RDF.type, types.get(i)); } }
public void testOmits(Model m, List<Statement> statements) { for (int i = 0; i < statements.size(); i += 1) assertFalse("it should not be here", m.contains(statements.get(i))); }