tripLL-0.1.0.0: A very simple triple store

Copyright(c) Philipp Pfeiffer, 2015
LicenseMIT
Maintainerpfiff@hax-f.net
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

TripLL

Contents

Description

Gives a basic interface to a triple store. See homepage for an example.

Synopsis

Base Types for Accesing and Querying

class Triplestore h b | h -> b where Source

The Triplestore typeclass is an interface for triple stores. Every backend of this library uses this interface.

Methods

put :: Triple b -> h -> IO () Source

most simple actions, a triple store has to support, put and del of triples:

del :: Triple b -> h -> IO () Source

batch :: [BatchAction b] -> h -> IO () Source

doing several simple actions in one go, one can use batch.

query :: QueryTriple b -> h -> IO [Triple b] Source

querying triples is done by filling in the known fields with 'Just x'.

withTrip :: FilePath -> (h -> IO a) -> IO a Source

createAndOpen :: FilePath -> IO h Source

open :: FilePath -> IO h Source

close :: h -> IO () Source

data Triple a Source

A Triple is just anything consisting of three ordered pieces.

Constructors

Triple 

Fields

subject :: a
 
predicate :: a
 
object :: a
 

data TriplePosition Source

TriplePosition gives a type for the fields within a Triple.

Constructors

Subject 
Predicate 
Object 

flatten :: Triple a -> (a, a, a) Source

flatten forgets about the description of the fields.

type QueryTriple a = Triple (Maybe a) Source

QueryTriple is a shorthand for Triple where the argument is encapsulated within a Maybe.

data BatchAction a Source

A BatchAction is either a Put or a Delete, i.e. either a `write given triple into database` or a `delete given triple from database`.

Constructors

Put (Triple a) 
Delete (Triple a)