[jgrapht-users] No such vertex in Graph error
Brought to you by:
barak_naveh,
perfecthash
From: Pallavi K. <kar...@gm...> - 2018-01-08 06:21:29
|
Hi, Have formed a DefaultDirectedGraph like this: public DirectedGraph<OWLEntity, DefaultEdge> OWLGraph = new DefaultDirectedGraph<OWLEntity, DefaultEdge>(DefaultEdge.class); Have added vertices and edges, Vertex list is printed as follows: System.out.println(OWLGraph.vertexSet()); The list shows the vertex: http://www.semanticweb.org/drkm/ontologies/2017/4/ untitled-ontology-82#Disease Am constructing all directed paths from the graph as follows: AllDirectedPaths allPathsGraph = new AllDirectedPaths(toGraph.OWLGraph); Here, OWLGraph is the default directed graph, Next, i call getAllPaths from source vertex http://www.semanticweb. org/drkm/ontologies/2017/4/untitled-ontology-82#Food to destination vertex: http://www.semanticweb.org/drkm/ontologies/2017/4/ untitled-ontology-82#Disease The stack trace shows the error as: java.lang.IllegalArgumentException: no such vertex in graph: http://www.semanticweb.org/drkm/ontologies/2017/4/ untitled-ontology-82#Disease at org.jgrapht.graph.AbstractGraph.assertVertexExist(AbstractGraph.java:132) at org.jgrapht.graph.AbstractBaseGraph.incomingEdgesOf( AbstractBaseGraph.java:365) at org.jgrapht.alg.AllDirectedPaths.edgeMinDistancesBackwards( AllDirectedPaths.java:158) at org.jgrapht.alg.AllDirectedPaths.getAllPaths(AllDirectedPaths.java:105) at org.jgrapht.alg.AllDirectedPaths.getAllPaths(AllDirectedPaths.java:69) at com.mycompany.semanticdistance.SemanticDistance.SemanticDistance( SemanticDistance.java:161) at com.mycompany.semanticdistance.SemanticDistance.loadOntology( SemanticDistance.java:136) at com.mycompany.semanticdistance.SemanticDistance.main( SemanticDistance.java:84) May i know how to resolve this? Kindly help. Thanks much in advance -- Regs, Pallavi Linkedin Profile : http://in.linkedin.com/pub/pallavi-karanth/b/b71/26b “Your time is limited, don’t waste it living someone else’s life. Don’t be trapped by dogma, which is living the result of other people’s thinking. Don’t let the noise of other opinions drown your own inner voice. And most important, have the courage to follow your heart and intuition, they somehow already know what you truly want to become. Everything else is secondary.” -- Steve Jobs |