}
}
private GraphNode addLanguages(GraphNode node, NonLiteral platformInstance, List<LanguageDescription> languages,
boolean copyToNode) {
TripleCollection graph = node.getGraph();
BNode listNode = new BNode();
RdfList list = new RdfList(listNode, graph);
LockableMGraph configGraph = getConfigGraph();
Lock readLock = configGraph.getLock().readLock();
for (LanguageDescription languageDescription : languages) {
NonLiteral languageUri = (NonLiteral) languageDescription.getResource().getNode();
list.add(languageUri);
if (copyToNode) {
readLock.lock();
try {
graph.addAll(new GraphNode(languageUri, configGraph).getNodeContext());
} finally {
readLock.unlock();
}
}
}
node.addProperty(PLATFORM.instance, platformInstance);
graph.add(new TripleImpl(platformInstance, RDF.type, PLATFORM.Instance));
graph.add(new TripleImpl(platformInstance, PLATFORM.languages, listNode));
graph.add(new TripleImpl(listNode, RDF.type, LANGUAGE.LanguageList));
if (!copyToNode) {
node = new GraphNode(node.getNode(), new UnionMGraph(graph, configGraph));
}
return node;
}