HGraphStorage-0.0.3: Graph database stored on disk

Safe HaskellNone
LanguageHaskell98

Database.Graph.HGraphStorage.Types

Description

Base types and simple functions on them

Synopsis

Documentation

type GraphUsableMonad m = (MonadBaseControl IO m, MonadResource m, MonadLogger m) Source

put our constraints in one synonym

type ObjectID = Int32 Source

IDs for objects

type ObjectTypeID = Int16 Source

IDs for types of objects

type RelationID = Int32 Source

IDs for relations

type RelationTypeID = Int16 Source

IDs for types of relations

type PropertyID = Int32 Source

IDs for property values

type PropertyTypeID = Int16 Source

IDs for types of properties

type DataTypeID = Int8 Source

IDs for data types

type PropertyValueOffset = Int64 Source

Offset of property value on value file

type PropertyValueLength = Int64 Source

Length of property value on value file

data Object Source

An object as represented in the object file

Constructors

Object 

Fields

oType :: ObjectTypeID

type of object

oFirstFrom :: RelationID

first relation starting from the object

oFirstTo :: RelationID

first relation arriving at the object

oFirstProperty :: PropertyID

first property

Instances

Eq Object 
Ord Object 
Read Object 
Show Object 
Generic Object 
Binary Object

Simple binary instance

Default Object

Simple default instance

Typeable * Object 
GraphIdSerializable ObjectID Object

Serialization methods for ObjectID + Object

type Rep Object 

objectSize :: Int64 Source

Size of an object record

binLength :: Binary b => b -> Int64 Source

Calculates the length of the binary serialization of the given object

data Relation Source

A relation as represented in the relation file

Constructors

Relation 

Fields

rFrom :: ObjectID

origin object

rFromType :: ObjectTypeID

origin object type

rTo :: ObjectID

target object

rToType :: ObjectTypeID

target object type

rType :: RelationTypeID

type of the relation

rFromNext :: RelationID

next relation of origin object

rToNext :: RelationID

next relation of target object

rFirstProperty :: PropertyID

first property id

Instances

Eq Relation 
Ord Relation 
Read Relation 
Show Relation 
Generic Relation 
Binary Relation

simple binary instance

Default Relation

simple default instance

Typeable * Relation 
GraphIdSerializable RelationID Relation

Serialization methods for RelationID + Relation

type Rep Relation 

relationSize :: Int64 Source

size of a relation record

data Property Source

A property as represented in the property file

Constructors

Property 

Fields

pType :: PropertyTypeID

type of the property

pNext :: PropertyID

next property id

pOffset :: PropertyValueOffset

offset of the value

pLength :: PropertyValueLength

length of the value

Instances

Eq Property 
Ord Property 
Read Property 
Show Property 
Generic Property 
Binary Property

simple binary instance

Default Property

simple default instance

Typeable * Property 
GraphIdSerializable PropertyID Property

Serialization methods for PropertyID + Property

type Rep Property 

propertySize :: Int64 Source

size of a property record

data PropertyType Source

Type of a property as represented in the property type file

Constructors

PropertyType 

Fields

ptDataType :: DataTypeID

Data type ID

ptFirstProperty :: PropertyID

first property of the type itself

Instances

Eq PropertyType 
Ord PropertyType 
Read PropertyType 
Show PropertyType 
Generic PropertyType 
Binary PropertyType

simple binary instance

Default PropertyType

simple default instance

Typeable * PropertyType 
GraphIdSerializable PropertyTypeID PropertyType

Serialization methods for PropertyTypeID + PropertyType

type Rep PropertyType 

propertyTypeSize :: Int64 Source

size of a property type record

data ObjectType Source

Type of an object as represented in the object type file

Constructors

ObjectType 

Fields

otFirstProperty :: PropertyID

First property of the type itself

Instances

Eq ObjectType 
Ord ObjectType 
Read ObjectType 
Show ObjectType 
Generic ObjectType 
Binary ObjectType

simple binary instance

Default ObjectType

simple default instance

Typeable * ObjectType 
GraphIdSerializable ObjectTypeID ObjectType

Serialization methods for ObjectTypeID + ObjectType

type Rep ObjectType 

objectTypeSize :: Int64 Source

Size of an object type record

data RelationType Source

Type of a relation as represented in the relation type file

Constructors

RelationType 

Fields

rtFirstProperty :: PropertyID

First property of the type itself

Instances

Eq RelationType 
Ord RelationType 
Read RelationType 
Show RelationType 
Generic RelationType 
Binary RelationType

simple binary instance

Default RelationType

simple default instance

Typeable * RelationType 
GraphIdSerializable RelationTypeID RelationType

Serialization methods for RelationTypeID + RelationType

type Rep RelationType 

relationTypeSize :: Int64 Source

Size of a relation type record

data Model Source

The current model: lookup tables between names and ids types of artifacts

Instances

Eq Model 
Ord Model 
Read Model 
Show Model 
Default Model

Default model: a "name" property property type with a name property

Typeable * Model 

namePropertyID :: PropertyTypeID Source

the ID of the "name" property

data Lookup a b Source

A lookup table allowing two ways lookup

Constructors

Lookup 

Fields

fromName :: Map b a
 
toName :: Map a b
 

Instances

(Eq a, Eq b) => Eq (Lookup a b) 
(Ord a, Ord b) => Ord (Lookup a b) 
(Ord a, Ord b, Read a, Read b) => Read (Lookup a b) 
(Show a, Show b) => Show (Lookup a b) 
Default (Lookup a b)

Default instance (empty tables)

Typeable (* -> * -> *) Lookup 

addToLookup :: (Ord a, Ord b) => a -> b -> Lookup a b -> Lookup a b Source

Add to the lookup maps

data DataType Source

the supported data types for properties

Constructors

DTText 
DTInteger 
DTBinary 

dataTypeID :: DataType -> DataTypeID Source

Convert a DataType object to its ID

dataType :: DataTypeID -> DataType Source

Convert a DataType ID to the Haskell object

valueType :: PropertyValue -> DataType Source

Get the data type for a given value

valueToIndex :: PropertyValue -> [Int16] Source

Get the value in a format ready to index

textToKey :: Text -> [Int16] Source

Transform a text in a index key

integerToKey :: Integer -> [Int16] Source

Transform an integer in a index key

bytestringToKey :: ByteString -> [Int16] Source

Transform a bytestring in a index key