swish-0.9.1.8: A semantic web toolkit.

Copyright(c) 2003 Graham Klyne 2009 Vasili I Galchin
2011 2012 2014 2016 Douglas Burke
LicenseGPL V2
MaintainerDouglas Burke
Stabilityexperimental
PortabilityCPP, FlexibleInstances, MultiParamTypeClasses
Safe HaskellSafe
LanguageHaskell98

Swish.GraphMem

Description

This module defines a simple memory-based graph instance.

Synopsis

Documentation

data GraphMem lb Source #

Simple memory-based graph type.

Constructors

GraphMem 

Fields

Instances

LDGraph GraphMem lb Source # 
Label lb => Eq (GraphMem lb) Source # 

Methods

(==) :: GraphMem lb -> GraphMem lb -> Bool #

(/=) :: GraphMem lb -> GraphMem lb -> Bool #

Label lb => Ord (GraphMem lb) Source # 

Methods

compare :: GraphMem lb -> GraphMem lb -> Ordering #

(<) :: GraphMem lb -> GraphMem lb -> Bool #

(<=) :: GraphMem lb -> GraphMem lb -> Bool #

(>) :: GraphMem lb -> GraphMem lb -> Bool #

(>=) :: GraphMem lb -> GraphMem lb -> Bool #

max :: GraphMem lb -> GraphMem lb -> GraphMem lb #

min :: GraphMem lb -> GraphMem lb -> GraphMem lb #

Label lb => Show (GraphMem lb) Source # 

Methods

showsPrec :: Int -> GraphMem lb -> ShowS #

show :: GraphMem lb -> String #

showList :: [GraphMem lb] -> ShowS #

Label lb => Monoid (GraphMem lb) Source # 

Methods

mempty :: GraphMem lb #

mappend :: GraphMem lb -> GraphMem lb -> GraphMem lb #

mconcat :: [GraphMem lb] -> GraphMem lb #

setArcs :: LDGraph lg lb => lg lb -> ArcSet lb -> lg lb Source #

Replace the existing arcs in the graph.

getArcs :: LDGraph lg lb => lg lb -> ArcSet lb Source #

Extract all the arcs from a graph

addGraphs :: (LDGraph lg lb, Ord lb) => lg lb -> lg lb -> lg lb Source #

Add the two graphs

delete :: (LDGraph lg lb, Ord lb) => lg lb -> lg lb -> lg lb Source #

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.

matchGraphMem Source #

Arguments

:: Label lb 
=> GraphMem lb 
-> GraphMem lb 
-> (Bool, LabelMap (ScopedLabel lb))

if the first element is True then the second value is a label map that maps each label to an equivalence-class identifier, otherwise emptyMap.

GraphMem matching function accepting GraphMem value and returning node map if successful