rdf4h-2.0.0: A library for RDF processing in Haskell

Safe HaskellNone
LanguageHaskell98

Data.RDF.Graph.MapSP

Description

A graph implementation mapping (S,P) pairs to O, backed by Map.

Synopsis

Documentation

data MapSP 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)

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

key:(http://example.com/s1,http://example.com/p1),
value:[http://example.com/o1,http://example.com/o2];

key:(http://example.com/s1,http://example.com/p2),
value:[http://example.com/o1];

key:(http://example.com/s2,http://example.com/p3),
value:[http://example.com/o3];