public DefaultLink getCopy(String newId) { if (this instanceof LabeledLink) return ((LabeledLink)this).copy(newId); else if (this instanceof CompactLink) return ((CompactLink)this).copy(newId); else { logger.error("cannot instanciate a link from the type: " + this.getType().toString()); return null; } } }
public static void printGraph(Graph<Node, DefaultLink> graph) { if (graph == null) { logger.debug("graph is null."); return; } StringBuffer sb = new StringBuffer(); sb.append("*** Nodes ***\n"); for (Node n : graph.vertexSet()) { sb.append(n.getLocalId()); sb.append("\n"); } sb.append("*** Links ***\n"); for (DefaultLink link : graph.edgeSet()) { sb.append(link.getId()); sb.append(", "); sb.append(link.getType().toString()); sb.append(", "); sb.append(link.getWeight()); sb.append("\n"); } // sb.append("------------------------------------------"); logger.debug(sb.toString()); }
public static void printLabeledGraph(Graph<Node, LabeledLink> graph) { if (graph == null) { logger.debug("graph is null."); return; } StringBuffer sb = new StringBuffer(); sb.append("*** Nodes ***\n"); for (Node n : graph.vertexSet()) { sb.append(n.getLocalId()); sb.append("\n"); } sb.append("*** Links ***\n"); for (DefaultLink link : graph.edgeSet()) { sb.append(link.getId()); sb.append(", "); sb.append(link.getType().toString()); sb.append(", "); sb.append(link.getWeight()); sb.append("\n"); } // sb.append("------------------------------------------"); logger.debug(sb.toString()); }
public CompactLink copy(String newId) { CompactLink newLink = null; if (this instanceof CompactObjectPropertyLink) newLink = new CompactObjectPropertyLink(newId, ((CompactObjectPropertyLink)this).getObjectPropertyType()); else if (this instanceof CompactSubClassLink) newLink = new CompactSubClassLink(newId); else logger.error("cannot instanciate a link from the type: " + this.getType().toString()); return newLink; } }
writer.name("id").value(link.getId()); writer.name("weight").value(link.getWeight()); writer.name("type").value(link.getType().toString()); if (link instanceof CompactObjectPropertyLink) writer.name("objectPropertyType").value( ((CompactObjectPropertyLink)link).getObjectPropertyType().toString());
l = new CompactSubClassLink(id); } else { logger.error("cannot instanciate a link from the type: " + type.toString()); return null;
logger.error("cannot instanciate a link from the type: " + e.getType().toString()); continue;
logger.error("cannot instanciate a link from the type: " + e.getType().toString()); continue;
logger.error("cannot instanciate a link from the type: " + e.getType().toString()); continue;
newLink = new ObjectPropertySpecializationLink(newId, ((ObjectPropertySpecializationLink)this).getSpecializedLinkId()); else logger.error("cannot instanciate a link from the type: " + this.getType().toString());
link = new ObjectPropertySpecializationLink(id, ((ObjectPropertySpecializationLink)e).getSpecializedLinkId()); else { logger.error("cannot instanciate a link from the type: " + e.getType().toString()); continue;