Copyright | (c) 2003, Graham Klyne, 2009 Vasili I Galchin, 2011, 2012, 2014, 2016 Douglas Burke |
---|---|
License | GPL V2 |
Maintainer | Douglas Burke |
Stability | experimental |
Portability | CPP, FlexibleInstances, MultiParamTypeClasses |
Safe Haskell | Safe |
Language | Haskell98 |
This module defines a simple memory-based graph instance.
- data GraphMem lb = GraphMem {}
- data LabelMem
- setArcs :: LDGraph lg lb => lg lb -> ArcSet lb -> lg lb
- getArcs :: LDGraph lg lb => lg lb -> ArcSet lb
- addGraphs :: (LDGraph lg lb, Ord lb) => lg lb -> lg lb -> lg lb
- delete :: (LDGraph lg lb, Ord lb) => lg lb -> lg lb -> lg lb
- extract :: (LDGraph lg lb, Ord lb) => Selector lb -> lg lb -> lg lb
- labels :: (LDGraph lg lb, Ord lb) => lg lb -> Set lb
- labelIsVar :: Label lb => lb -> Bool
- labelHash :: Label lb => Int -> lb -> Int
- matchGraphMem :: Label lb => GraphMem lb -> GraphMem lb -> (Bool, LabelMap (ScopedLabel lb))
Documentation
Simple memory-based graph type.
Minimal graph label value - for testing
setArcs :: LDGraph lg lb => lg lb -> ArcSet lb -> lg lb Source
Replace the existing arcs in the graph.
Remove those arcs in the first graph from the second graph
extract :: (LDGraph lg lb, Ord lb) => Selector lb -> lg lb -> lg lb Source
Extract those arcs that match the given Selector
.
labels :: (LDGraph lg lb, Ord lb) => lg lb -> Set lb Source
Enumerate the distinct labels contained in a graph;
that is, any label that appears in the subject,
predicate or object position of an Arc
.
labelIsVar :: Label lb => lb -> Bool Source
Does this node have a variable binding?
labelHash :: Label lb => Int -> lb -> Int Source
Calculate the hash of the label using the supplied seed.
:: Label lb | |
=> GraphMem lb | |
-> GraphMem lb | |
-> (Bool, LabelMap (ScopedLabel lb)) | if the first element is |
GraphMem matching function accepting GraphMem value and returning node map if successful