BNode resultResource = new BNode();
MGraph contentGraph = cgProvider.getContentGraph();
MGraph additionGraph = new SimpleMGraph();
UnionMGraph resultGraph = new UnionMGraph(additionGraph, contentGraph);
RdfList list = RdfList.createEmptyList(resultResource, additionGraph);
resultGraph.add(new TripleImpl(resource,
SCRIPTMANAGER.scriptList, resultResource));
resultGraph.add(new TripleImpl(resultResource, RDF.type,
SCRIPTMANAGER.ScriptList));
Iterator<Triple> it =
contentGraph.filter(null, RDF.type, SCRIPT.Script);
while (it.hasNext()) {
list.add(it.next().getSubject());
}
return new GraphNode(resultResource,
new UnionMGraph(resultGraph, contentGraph));
}