net-spider-0.4.3.7: A graph database middleware to maintain a time-varying graph.
MaintainerToshio Ito <debug.ito@gmail.com>
Safe HaskellNone
LanguageHaskell2010

NetSpider.GraphML.Writer

Description

This module defines tools to serialize a SnapshotGraph into GraphML format.

Since: 0.3.1.0

Synopsis

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.

accessors for WriteOption

woptDefaultDirected :: WriteOption -> Bool Source #

If True, set GraphML's edgedefault attribute to directed. If False, set it to undirected. Note that regardless of this option, each edge element specifies directed attribute explicitly.

Default: True

NodeID

type NodeID = Text Source #

Node ID in GraphML.

class ToNodeID a where Source #

Type that can be converted to NodeID.

Methods

toNodeID :: a -> NodeID Source #

Instances

Instances details
ToNodeID Bool Source # 
Instance details

Defined in NetSpider.GraphML.Writer

Methods

toNodeID :: Bool -> NodeID Source #

ToNodeID Double Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Float Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Int Source # 
Instance details

Defined in NetSpider.GraphML.Writer

Methods

toNodeID :: Int -> NodeID Source #

ToNodeID Int8 Source # 
Instance details

Defined in NetSpider.GraphML.Writer

Methods

toNodeID :: Int8 -> NodeID Source #

ToNodeID Int16 Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Int32 Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Int64 Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Integer Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Word Source # 
Instance details

Defined in NetSpider.GraphML.Writer

Methods

toNodeID :: Word -> NodeID Source #

ToNodeID Word8 Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Word16 Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Word32 Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID String Source # 
Instance details

Defined in NetSpider.GraphML.Writer

ToNodeID Text Source # 
Instance details

Defined in NetSpider.GraphML.Writer

Methods

toNodeID :: Text -> NodeID Source #

ToNodeID Text Source # 
Instance details

Defined in NetSpider.GraphML.Writer

Methods

toNodeID :: Text -> NodeID Source #

nodeIDByShow :: Show a => a -> NodeID Source #

Make a NodeID by calling show.

Attributes (re-exports)

type AttributeKey = Text Source #

Key of attribute.

data AttributeValue Source #

Typed value of attribute.

Instances

Instances details
Eq AttributeValue Source # 
Instance details

Defined in NetSpider.GraphML.Attribute

Ord AttributeValue Source # 
Instance details

Defined in NetSpider.GraphML.Attribute

Show AttributeValue Source # 
Instance details

Defined in NetSpider.GraphML.Attribute

ToJSON AttributeValue Source #

Since: 0.4.1.0

Instance details

Defined in NetSpider.GraphML.Attribute

FromJSON AttributeValue Source #

Based on valueFromAeson.

Since: 0.4.1.0

Instance details

Defined in NetSpider.GraphML.Attribute

ToAttributes [(AttributeKey, AttributeValue)] Source # 
Instance details

Defined in NetSpider.GraphML.Attribute

class ToAttributes a where Source #

Type that can be converted to list of attributes.

Instances

Instances details
ToAttributes () Source # 
Instance details

Defined in NetSpider.GraphML.Attribute

ToAttributes TimeZone Source #

Since: 0.4.1.0

Instance details

Defined in NetSpider.GraphML.Attribute

ToAttributes Timestamp Source #

Since: 0.4.1.0

Instance details

Defined in NetSpider.Timestamp

ToAttributes [(AttributeKey, AttributeValue)] Source # 
Instance details

Defined in NetSpider.GraphML.Attribute

ToAttributes a => ToAttributes (Maybe a) Source #

Nothing is mapped to empty attributes.

Instance details

Defined in NetSpider.GraphML.Attribute

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.