Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Spider n na fla
- connectWS :: Eq n => Host -> Port -> IO (Spider n na la)
- connectWith :: Config n na fla -> IO (Spider n na fla)
- close :: Spider n na fla -> IO ()
- withSpider :: Config n na fla -> (Spider n na fla -> IO a) -> IO a
- addFoundNode :: (ToJSON n, LinkAttributes fla, NodeAttributes na) => Spider n na fla -> FoundNode n na fla -> IO ()
- getSnapshotSimple :: (FromGraphSON n, ToJSON n, Ord n, Hashable n, Show n, LinkAttributes fla, NodeAttributes na) => Spider n na fla -> n -> IO (SnapshotGraph n na fla)
- getSnapshot :: (FromGraphSON n, ToJSON n, Ord n, Hashable n, Show n, LinkAttributes fla, NodeAttributes na) => Spider n na fla -> Query n na fla sla -> IO (SnapshotGraph n na sla)
- clearAll :: Spider n na fla -> IO ()
Spider type
An IO agent of the NetSpider database.
- Type
n
: node ID. Note that type of node ID has nothing to do with type of vertex ID used by Gremlin implementation. Node ID (in net-spider) is stored as a vertex property. SeenodeIdKey
config field. - Type
na
: node attributes. It should implementNodeAttributes
class. You can set this to()
if you don't need node attributes. - Type
fla
: attributes of found links. It should implementLinkAttributes
class. You can set this to()
if you don't need link attributes.
Make Spider
connectWS :: Eq n => Host -> Port -> IO (Spider n na la) Source #
Connect to the WebSocket endpoint of Tinkerpop Gremlin Server that hosts the NetSpider database.
connectWith :: Config n na fla -> IO (Spider n na fla) Source #
Connect to the server with the given Config
.
Close Spider
Bracket form
withSpider :: Config n na fla -> (Spider n na fla -> IO a) -> IO a Source #
Connect the spider, run the given action and close the connection.
Since: 0.3.2.0
Graph operations
addFoundNode :: (ToJSON n, LinkAttributes fla, NodeAttributes na) => Spider n na fla -> FoundNode n na fla -> IO () Source #
Add a FoundNode
(observation of a node) to the NetSpider
database.
:: (FromGraphSON n, ToJSON n, Ord n, Hashable n, Show n, LinkAttributes fla, NodeAttributes na) | |
=> Spider n na fla | |
-> n | ID of the node where it starts traversing. |
-> IO (SnapshotGraph n na fla) |
Simple version of getSnapshot
. It builds the snapshot graph by
traversing the history graph from the given starting node.
This function is very simple, and should be used only for small graphs.
getSnapshot :: (FromGraphSON n, ToJSON n, Ord n, Hashable n, Show n, LinkAttributes fla, NodeAttributes na) => Spider n na fla -> Query n na fla sla -> IO (SnapshotGraph n na sla) Source #
Get the snapshot graph from the history graph as specified by the
Query
.