options.put(option, valueProperty.getFirstValue().toString());
}
}
// Read the namespaces ...
ExecutionContext context = getExecutionContext();
Node namespacesNode = subgraph.getNode(DnaLexicon.NAMESPACES);
if (namespacesNode != null) {
GraphNamespaceRegistry registry = new GraphNamespaceRegistry(configuration, namespacesNode.getLocation().getPath(),
DnaLexicon.NAMESPACE_URI);
context = context.with(registry);
}
// Get the name of the source ...
Property property = subgraph.getRoot().getProperty(DnaLexicon.SOURCE_NAME);
if (property == null || property.isEmpty()) {
String readableName = readable(DnaLexicon.SOURCE_NAME);
String readablePath = readable(subgraph.getLocation());
String msg = JcrI18n.propertyNotFoundOnNode.text(readableName, readablePath, configuration.getCurrentWorkspaceName());
throw new RepositoryException(msg);
}
String sourceName = context.getValueFactories().getStringFactory().create(property.getFirstValue());
// Create the repository ...
JcrRepository repository = new JcrRepository(context, connectionFactory, sourceName, descriptors, options);
// Register all the the node types ...