| Maintainer | Toshio Ito <debug.ito@gmail.com> |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
NetSpider.GraphML.Writer
Description
This module defines tools to serialize a SnapshotGraph into
GraphML
format.
Since: 0.3.1.0
Synopsis
- writeGraphML :: (ToNodeID n, ToAttributes na, ToAttributes la) => SnapshotGraph n na la -> Text
- writeGraphMLWith :: (ToNodeID n, ToAttributes na, ToAttributes la) => WriteOption -> SnapshotGraph n na la -> Text
- data WriteOption
- defWriteOption :: WriteOption
- woptDefaultDirected :: WriteOption -> Bool
- type NodeID = Text
- class ToNodeID a where
- nodeIDByShow :: Show a => a -> NodeID
- type AttributeKey = Text
- data AttributeValue
- class ToAttributes a where
- toAttributes :: a -> [(AttributeKey, AttributeValue)]
- valueFromAeson :: Value -> Maybe AttributeValue
- attributesFromAeson :: Value -> Maybe [(AttributeKey, AttributeValue)]
Functions
writeGraphML :: (ToNodeID n, ToAttributes na, ToAttributes la) => SnapshotGraph n na la -> Text Source #
writeGraphMLWith the default options.
writeGraphMLWith :: (ToNodeID n, ToAttributes na, ToAttributes la) => WriteOption -> SnapshotGraph n na la -> Text Source #
Show the SnapshotGraph into GraphML format. WriteOption
controls the conversion.
Options
data WriteOption Source #
Options to write GraphML. Use defWriteOption to get the default
values.
Instances
| Eq WriteOption Source # | |
Defined in NetSpider.GraphML.Writer | |
| Ord WriteOption Source # | |
Defined in NetSpider.GraphML.Writer Methods compare :: WriteOption -> WriteOption -> Ordering # (<) :: WriteOption -> WriteOption -> Bool # (<=) :: WriteOption -> WriteOption -> Bool # (>) :: WriteOption -> WriteOption -> Bool # (>=) :: WriteOption -> WriteOption -> Bool # max :: WriteOption -> WriteOption -> WriteOption # min :: WriteOption -> WriteOption -> WriteOption # | |
| Show WriteOption Source # | |
Defined in NetSpider.GraphML.Writer Methods showsPrec :: Int -> WriteOption -> ShowS # show :: WriteOption -> String # showList :: [WriteOption] -> ShowS # | |
accessors for WriteOption
NodeID
class ToNodeID a where Source #
Type that can be converted to NodeID.
Instances
Attributes (re-exports)
type AttributeKey = Text Source #
Key of attribute.
data AttributeValue Source #
Typed value of attribute.
Constructors
| AttrBoolean Bool | |
| AttrInt Int | |
| AttrLong Integer | |
| AttrFloat Float | |
| AttrDouble Double | |
| AttrString Text |
Instances
class ToAttributes a where Source #
Type that can be converted to list of attributes.
Methods
toAttributes :: a -> [(AttributeKey, AttributeValue)] Source #
Instances
| ToAttributes () Source # | |
Defined in NetSpider.GraphML.Attribute Methods toAttributes :: () -> [(AttributeKey, AttributeValue)] Source # | |
| ToAttributes TimeZone Source # | Since: 0.4.1.0 |
Defined in NetSpider.GraphML.Attribute Methods toAttributes :: TimeZone -> [(AttributeKey, AttributeValue)] Source # | |
| ToAttributes Timestamp Source # | Since: 0.4.1.0 |
Defined in NetSpider.Timestamp Methods toAttributes :: Timestamp -> [(AttributeKey, AttributeValue)] Source # | |
| ToAttributes [(AttributeKey, AttributeValue)] Source # | |
Defined in NetSpider.GraphML.Attribute Methods toAttributes :: [(AttributeKey, AttributeValue)] -> [(AttributeKey, AttributeValue)] Source # | |
| ToAttributes a => ToAttributes (Maybe a) Source # |
|
Defined in NetSpider.GraphML.Attribute Methods toAttributes :: Maybe a -> [(AttributeKey, AttributeValue)] Source # | |
valueFromAeson :: Value -> Maybe AttributeValue Source #
Make AttributeValue from aeson's Value. It returns
Nothing, if the input is null, an object or an array. If the
input is a number, the output uses AttrDouble.
attributesFromAeson :: Value -> Maybe [(AttributeKey, AttributeValue)] Source #
Make attributes from aeson's Value. It assumes the input
is an object, and its values can be converted by
valueFromAeson. Otherwise, it returns Nothing.