@Override protected void removeWithoutCommit(Resource subj, IRI pred, Value obj, Resource... contexts) throws RepositoryException { Model model = committed.filter(subj, pred, obj, contexts); removed.addAll(model); }
public static Model union(Model... theGraphs) { Model aModel = newModel(); Model[] var2 = theGraphs; int var3 = theGraphs.length; for(int var4 = 0; var4 < var3; ++var4) { Model aGraph = var2[var4]; aModel.addAll(aGraph); } return aModel; }
protected static void read(Model repos, String ontology) throws RDFParseException, IOException { String filename = "onto/" + ontology; InputStream ins = OntoReader.class.getClassLoader() .getResourceAsStream(filename); if(filename.endsWith(".ttl")) { repos.addAll(Rio.parse(ins, "",RDFFormat.TURTLE)); } else { repos.addAll(Rio.parse(ins, "",RDFFormat.RDFXML)); } } }
protected static void read(Model repos, String ontology) throws RDFParseException, IOException { String filename = "onto/" + ontology; InputStream ins = OntoReader.class.getClassLoader() .getResourceAsStream(filename); if(filename.endsWith(".ttl")) { repos.addAll(Rio.parse(ins, "",RDFFormat.TURTLE)); } else { repos.addAll(Rio.parse(ins, "",RDFFormat.RDFXML)); } } }
/** * Add this graph to the set of data to be added, to the specified named graph, when this operation is executed * @param theGraphURI the named graph the data should be added to * @param theGraph the data to add */ public void add(final java.net.URI theGraphURI, final Model theGraph) { Model aGraph = mAdd.get(theGraphURI); if (aGraph == null) { aGraph = Models2.newModel(); } aGraph.addAll(theGraph); mAdd.put(theGraphURI, aGraph); }
/** * Add this graph to the set of data to be removed, from the specified named graph, when this operation is executed * @param theGraphURI the named graph the data should be removed from * @param theGraph the data to remove */ public void remove(final java.net.URI theGraphURI, final Model theGraph) { Model aGraph = mRemove.get(theGraphURI); if (aGraph == null) { aGraph = Models2.newModel(); } aGraph.addAll(theGraph); mRemove.put(theGraphURI, aGraph); }
finalModel.addAll(node.model);
model.addAll(valInst.model);
private synchronized Set<Statement> queueBlankStatements(SubjectInContext key) { Model firstMatch = blanks.filter(key.getSubject(), null, null, key.getContext()); Model matches = firstMatch.isEmpty() ? blankReferences.filter(key.getSubject(), null, null, key.getContext()) : firstMatch; if (matches.isEmpty()) { return null; } Set<Statement> set = stmtBySubject.get(key); if (set == null) { stmtBySubject.put(key, set = new TreeSet<>(comparator)); } set.addAll(matches); if (firstMatch.isEmpty()) { // repeat blank node values queueSize += matches.size(); } else { if (repeatBlankNodes && key.getSubject() instanceof BNode && isStillReferenced(key)) { blankReferences.addAll(matches); } blanks.remove(key.getSubject(), null, null, key.getContext()); } return set; }
private synchronized Set<Statement> queueBlankStatements(SubjectInContext key) { Model firstMatch = blanks.filter(key.getSubject(), null, null, key.getContext()); Model matches = firstMatch.isEmpty() ? blankReferences.filter(key.getSubject(), null, null, key.getContext()) : firstMatch; if (matches.isEmpty()) { return null; } Set<Statement> set = stmtBySubject.get(key); if (set == null) { stmtBySubject.put(key, set = new TreeSet<Statement>(comparator)); } set.addAll(matches); if (firstMatch.isEmpty()) { // repeat blank node values queueSize += matches.size(); } else { if (repeatBlankNodes && key.getSubject() instanceof BNode && isStillReferenced(key)) { blankReferences.addAll(matches); } blanks.remove(key.getSubject(), null, null, key.getContext()); } return set; }
ResourceBuilder aIndividual = write(aVal); aList.add(aIndividual.getResource()); theBuilder.model().addAll(aIndividual.model());