private static boolean isSubsetInternal(Model model1, Model model2) { // try to create a full blank node mapping return matchModels(model1, model2); }
private static boolean isSubsetInternal(Model model1, Model model2) { // try to create a full blank node mapping return matchModels(model1, model2); }
private static boolean matchModels(Model model1, Model model2) { // Compare statements without blank nodes first, save the rest for later List<Statement> model1BNodes = new ArrayList<Statement>(model1.size()); for (Statement st : model1) { if (isBlank(st.getSubject()) || isBlank(st.getObject()) || isBlank(st.getContext())) { model1BNodes.add(st); } else { if (!model2.contains(st)) { return false; } } } return matchModels(model1BNodes, model2, new HashMap<Resource, Resource>(), 0); }
private static boolean matchModels(Model model1, Model model2) { // Compare statements without blank nodes first, save the rest for later List<Statement> model1BNodes = new ArrayList<>(model1.size()); for (Statement st : model1) { if (isBlank(st.getSubject()) || isBlank(st.getObject()) || isBlank(st.getContext())) { model1BNodes.add(st); } else { if (!model2.contains(st)) { return false; } } } return matchModels(model1BNodes, model2, new HashMap<>(), 0); }
result = matchModels(model1, model2, newBNodeMapping, idx + 1);
result = matchModels(model1, model2, newBNodeMapping, idx + 1);