// Declare internal and external roots
for(RootSpec r : configuration.roots) {
- Resource type = graph.getPossibleType(r.resource, L0.Entity);
- if(type == null) type = L0.Entity;
+ String typeId = r.type;
+ if (typeId == null) {
+ Resource type = graph.getPossibleType(r.resource, L0.Entity);
+ typeId = type != null ? graph.getURI(type) : Layer0.URIs.Entity;
+ }
int id = state.ids.get(support.getTransientId(r.resource));
- Root root = new Root(r.name, graph.getURI(type));
+ Root root = new Root(r.name, typeId);
Identity rootId = new Identity(id,root);
internalMap.put(id, rootId);
procedure.execute(rootId);
if(state.internalEntries != null) {
for(InternalEntry ie : state.internalEntries) {
- if(ie.parent != null && ie.name != null) {
- procedure.execute(resolveInternal(graph, support, ie, internalMap));
+ if(ie.parent != null) {
+ if(ie.name != null) {
+ procedure.execute(resolveInternal(graph, support, ie, internalMap));
+ } else {
+ // In this case there is a child that has no HasName => this should be treated as a blank
+ }
} else {
throw new DatabaseException("Invalid internal entry " + ie);
}