+ private static String typeId(ReadGraph graph, Layer0 L0, String indexRootUri, Resource r) throws DatabaseException {
+ Resource type = graph.getPossibleType(r, L0.Entity);
+ if (type == null)
+ return Layer0.URIs.Entity;
+ String typeUri = graph.getPossibleURI(type);
+ if (typeUri == null || !typeUri.startsWith(indexRootUri))
+ return typeUri;
+ return "%model" + typeUri.substring(indexRootUri.length());
+ }
+