-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pangraph.GraphML.Writer does not write VertexID etc. #41
Comments
@debug-ito Thanks for the report -- could you give a simple example with an expected and produced output? |
Sure. {-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import qualified Data.ByteString as B
import Pangraph (makePangraph, makeVertex, makeEdge)
import qualified Pangraph.GraphML.Writer as GraphML
main :: IO ()
main = B.putStrLn $ GraphML.write graph
where
(Just graph) = makePangraph vertices edges
vertices = [ makeVertex "foo" [],
makeVertex "bar" [],
makeVertex "buzz" []
]
edges = [ makeEdge ("foo", "bar") [],
makeEdge ("bar", "buzz") [],
makeEdge ("buzz", "foo") []
] Got:
Expected:
|
@debug-ito Great, thank you! I'm not sure I'll find time for this soon, so PRs are welcome. (Or, perhaps, @thisiswhereitype could have a look.) |
OK, I'll make a pull-request. |
Wait, I just checked test/GraphML.hs. That test deals with Pangraph.Examples.SampleGraph.sampleGraph, which is defined as: smallGraph :: Pangraph
smallGraph = fromJust graph
where
graph =
makePangraph
[makeVertex "n0" [("id","n0")]
,makeVertex "n1" [("id","n1")]
,makeVertex "n2" [("id","n2")]]
[makeEdge ("n0", "n2")
[("source","n0"),("target","n2")]] So, according to this test, users of Pangraph are supposed to make |
@debug-ito The main purpose of Pangraph is to serve as a bridge for converting between various graph formats. It's internal graph representation is not really intended to be used for graph description -- for that you can use other graph libraries, which may be more suited for the task. With that in mind, I think the answer to your question
is negative: No, we do not expect the internal graph representation of Pangraph to be used, and it may change in future. However, it is still important to have good documentation for the library to avoid confusion. So, if you think that the library's README or Haddock documentation can be improved, please let us know. Thank you! |
I don't think Pangraph.GraphML.Writer writes VertexID of a Vertex or edgeID, source or target of an Edge. This makes the result GraphML data invalid.
The text was updated successfully, but these errors were encountered: