net-spider-0.3.2.1: A graph database middleware to maintain a time-varying graph.

MaintainerToshio Ito <debug.ito@gmail.com>
Safe HaskellNone
LanguageHaskell2010

NetSpider.GraphML.Writer

Contents

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

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
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

type AttributeKey = Text Source #

Key of attribute.

class ToAttributes a where Source #

Type that can be converted to list of attributes.

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.