Re: [jgrapht-users] No such vertex in Graph error
Brought to you by:
barak_naveh,
perfecthash
From: J K. <j.k...@gm...> - 2018-01-08 08:52:22
|
Most likely, this is the issue: https://github.com/jgrapht/jgrapht/wiki/EqualsAndHashCode On Mon, Jan 8, 2018 at 1:21 AM, Pallavi Karanth <kar...@gm...> wrote: > 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/unti > tled-ontology-82#Disease > at org.jgrapht.graph.AbstractGraph.assertVertexExist(AbstractGr > aph.java:132) > at org.jgrapht.graph.AbstractBaseGraph.incomingEdgesOf(Abstract > BaseGraph.java:365) > at org.jgrapht.alg.AllDirectedPaths.edgeMinDistancesBackwards(A > llDirectedPaths.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.SemanticDist > ance(SemanticDistance.java:161) > at com.mycompany.semanticdistance.SemanticDistance. > loadOntology(SemanticDistance.java:136) > at com.mycompany.semanticdistance.SemanticDistance.main(Semanti > cDistance.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 > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > |