swish-0.3.2.1: A semantic web toolkit.

PortabilityDeriveFunctor, DeriveFoldable, DeriveTraversable, FlexibleInstances, MultiParamTypeClasses
Stabilityexperimental
MaintainerDouglas Burke

Swish.RDF.GraphMem

Description

This module defines a simple memory-based graph instance.

Synopsis

Documentation

data GraphMem lb Source

Memory-based graph type

Constructors

GraphMem 

Fields

arcs :: [Arc lb]
 

setArcs :: LDGraph lg lb => [Arc lb] -> lg lb -> lg lbSource

Replace the existing arcs in the graph.

getArcs :: LDGraph lg lb => lg lb -> [Arc lb]Source

Extract all the arcs from a graph

add :: LDGraph lg lb => lg lb -> lg lb -> lg lbSource

Add the two graphs

deleteSource

Arguments

:: LDGraph lg lb 
=> lg lb

g1

-> lg lb

g2

-> lg lb

g2 - g1 -> g3

Remove those arcs in the first graph from the second graph

extract :: LDGraph lg lb => Selector lb -> lg lb -> lg lbSource

Extract those arcs that match the given Selector.

labels :: LDGraph lg lb => lg lb -> [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.

data LabelMem Source

Minimal graph label value - for testing

Constructors

LF String 
LV String 

labelIsVar :: Label lb => lb -> BoolSource

Does this node have a variable binding?

labelHash :: Label lb => Int -> lb -> IntSource

Calculate the hash of the label using the supplied seed.

matchGraphMemSource

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