+ //System.err.println("getComponentTypeAndRoot1 " + property.getURI(graph) + " => " + graph.getPossibleURI(type) + " " + graph.getPossibleURI(root));
+ return Pair.make(type, root);
+ }
+ }
+ while(represents == null) {
+ parent = parent.getParent(graph);
+ represents = parent.getPossibleRepresents(graph);
+ }
+// Resource root = graph.syncRequest(new IndexRoot(property.getRepresents(graph)));
+ Resource componentType = parent.getType(graph);
+ Resource root = graph.syncRequest(new IndexRoot(parent.getRepresents(graph)));
+ //System.err.println("getComponentTypeAndRoot2 " + property.getURI(graph) + " => " + graph.getPossibleURI(componentType) + " " + graph.getPossibleURI(root));
+ return Pair.make(componentType, root);
+ }
+
+ private static Pair<Resource,Resource> getComponentTypeAndRoot(ReadGraph graph, Resource component) throws DatabaseException {
+ if(component != null) {
+ Resource type = graph.syncRequest(new FindPossibleComponentTypeRequest(component));
+ if(type != null) {
+ Resource root = graph.syncRequest(new IndexRoot(type));
+ // System.err.println("getComponentTypeAndRoot3 " + graph.getPossibleURI(component) + " => " + graph.getPossibleURI(type) + " " + graph.getPossibleURI(root));