rdf4h-3.0.4: A library for RDF processing in Haskell

Safe HaskellNone
LanguageHaskell98

Data.RDF.Graph.AdjHashMap

Description

A graph implementation mapping hashed S to a mapping of hashed P to hashed O, backed by HashMap.

Synopsis

Documentation

data AdjHashMap Source #

A map-based graph implementation.

This instance of RDF is an adjacency map with each subject mapping to a mapping from a predicate node to to the adjacent nodes via that predicate.

Given the following triples graph::

  (http://example.com/s1,http://example.com/p1,http://example.com/o1)
  (http://example.com/s1,http://example.com/p1,http://example.com/o2)
  (http://example.com/s1,http://example.com/p2,http://example.com/o1)
  (http://example.com/s2,http://example.com/p3,http://example.com/o3)

where

hash "http://example.com/s1" = 1600134414
hash "http://example.com/s2" = 1600134413
hash "http://example.com/p1" = 1616912099
hash "http://example.com/p2" = 1616912096
hash "http://example.com/p3" = 1616912097
hash "http://example.com/o1" = 1935686794
hash "http://example.com/o2" = 1935686793
hash "http://example.com/o3" = 1935686792

the in-memory hashmap representation of the triples graph is:

key:1600134414, value:(key:1616912099, value:[1935686794    -- (../s1,../p1,../o1)
                                             ,1935686793];  -- (../s1,../p1,../o2)
                       key:1616912096, value:[1935686794]); -- (../s1,../p2,../o1)
key:1600134413, value:(key:1616912097, value:[1935686792])  -- (../s1,../p3,../o3)

Worst-case time complexity of the graph functions, with respect to the number of triples, are:

Instances

Generic AdjHashMap Source # 

Associated Types

type Rep AdjHashMap :: * -> * #

Binary AdjHashMap Source # 
NFData AdjHashMap Source # 

Methods

rnf :: AdjHashMap -> () #

Rdf AdjHashMap Source # 
Generic (RDF AdjHashMap) Source # 

Associated Types

type Rep (RDF AdjHashMap) :: * -> * #

NFData (RDF AdjHashMap) Source # 

Methods

rnf :: RDF AdjHashMap -> () #

type Rep AdjHashMap Source # 
type Rep AdjHashMap = D1 * (MetaData "AdjHashMap" "Data.RDF.Graph.AdjHashMap" "rdf4h-3.0.4-HCQC390ils5CrJV2mgsNqv" False) (V1 *)
data RDF AdjHashMap Source # 
type Rep (RDF AdjHashMap) Source #