final String msg = "Error loading documents";
throw new DatabaseError(schema, msg, e);
}
// load namespaces
NamespaceTable nt = p2pn.getNamespaceTable();
Set<TableNamespace> nsl = nt.getNamespaces();
Map<TableNamespace, Integer> nsi = nt.getNamespaceIndex();
for (TableNamespace ns : nsl) {
try {
jkl.loadNamespace(nsi.get(ns), ns);
} catch (SQLException e) {
final String fmt = "Error loading namespace %s/%s";
final String msg =
format(fmt, ns.getPrefix(), ns.getResourceLocation());
throw new DatabaseError(schema, msg, e);
}
}
// load annotation definitions
try {
jkl.loadAnnotationDefinitions(p2pn.getAnnotationDefinitionTable());
} catch (SQLException e) {
final String msg = "Error loading annotation definitions";
throw new DatabaseError(schema, msg, e);
}
try {
// load annotations
jkl.loadAnnotationValues(p2pn.getAnnotationValueTable());
} catch (SQLException e) {
final String msg = "Error loading annotation values";
throw new DatabaseError(schema, msg, e);
}
try {
// load document to namespace map
jkl.loadDocumentNamespaceMap(nt.getDocumentNamespaces());
} catch (SQLException e) {
final String msg = "Error loading document namespaces";
throw new DatabaseError(schema, msg, e);
}