| Copyright | (c) Philipp Pfeiffer, 2015 |
|---|---|
| License | MIT |
| Maintainer | pfiff@hax-f.net |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
TripLL
Description
Gives a basic interface to a triple store. See homepage for an example.
- class Triplestore h b | h -> b where
- data Triple a = Triple {}
- data TriplePosition
- flatten :: Triple a -> (a, a, a)
- type QueryTriple a = Triple (Maybe a)
- data BatchAction a
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
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
A Triple is just anything consisting of three ordered pieces.
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`.