Safe Haskell | None |
---|---|
Language | Haskell98 |
Database.Neo4j.Types
- (<>) :: Monoid a => a -> a -> a
- data Val
- data PropertyValue
- = ValueProperty Val
- | ArrayProperty [Val]
- class PropertyValueConstructor a where
- newval :: a -> PropertyValue
- (|:) :: PropertyValueConstructor a => Text -> a -> (Text, PropertyValue)
- type Properties = HashMap Text PropertyValue
- emptyProperties :: HashMap Text PropertyValue
- urlPath :: Text -> Text
- urlMinPath :: Text -> Text
- data EntityObj
- class Entity a where
- entityPath :: a -> ByteString
- propertyPath :: a -> ByteString
- getEntityProperties :: a -> Properties
- setEntityProperties :: a -> Properties -> a
- entityObj :: a -> EntityObj
- newtype NodeUrl = NodeUrl {
- runNodeUrl :: Text
- data Node = Node {}
- getNodeProperties :: Node -> Properties
- nodeAPI :: ByteString
- nodeAPITxt :: Text
- newtype NodePath = NodePath {
- runNodePath :: Text
- class NodeIdentifier a where
- getNodePath :: a -> NodePath
- runNodeIdentifier :: NodeIdentifier a => a -> ByteString
- type RelationshipType = Text
- data Direction
- newtype RelUrl = RelUrl {}
- data Relationship = Relationship {}
- getRelProperties :: Relationship -> Properties
- getRelType :: Relationship -> RelationshipType
- relationshipAPI :: ByteString
- relationshipAPITxt :: Text
- newtype RelPath = RelPath {
- runRelPath :: Text
- class RelIdentifier a where
- getRelPath :: a -> RelPath
- runRelIdentifier :: RelIdentifier a => a -> ByteString
- data EntityPath
- class EntityIdentifier a where
- getEntityPath :: a -> EntityPath
- type Label = Text
- data Index = Index {
- indexLabel :: Label
- indexProperties :: [Text]
- data Neo4jException
- data Connection = Connection {}
- type Hostname = ByteString
- type Port = Int
- newtype Neo4j a = Neo4j {
- runNeo4j :: Connection -> IO a
Documentation
Type for a single value of a Neo4j property
data PropertyValue Source
Wrapping type for a Neo4j single property or array of properties Using these types allows type checking for only correct properties that is int, double, string, boolean and single typed arrays of these, also nulls are not allowed
Constructors
ValueProperty Val | |
ArrayProperty [Val] |
Instances
Eq PropertyValue | |
Show PropertyValue | |
ToJSON PropertyValue | Specifying how to convert property values to JSON |
FromJSON PropertyValue | JSON to property values |
class PropertyValueConstructor a where Source
This class allows easy construction of property value types from literals
Methods
newval :: a -> PropertyValue Source
(|:) :: PropertyValueConstructor a => Text -> a -> (Text, PropertyValue) Source
This operator allows easy construction of property value types from literals
type Properties = HashMap Text PropertyValue Source
We use hashmaps to represent Neo4j properties
emptyProperties :: HashMap Text PropertyValue Source
Shortcut for emtpy properties
urlPath :: Text -> Text Source
Tries to get the path from a URL, we try our best otherwise return the url as is
urlMinPath :: Text -> Text Source
Path without the dbdata part, useful for batch paths and such
Constructors
EntityNode Node | |
EntityRel Relationship |
Class for top-level Neo4j entities (nodes and relationships) useful to have generic property management code
Methods
entityPath :: a -> ByteString Source
propertyPath :: a -> ByteString Source
getEntityProperties :: a -> Properties Source
setEntityProperties :: a -> Properties -> a Source
Constructors
NodeUrl | |
Fields
|
Representation of a Neo4j node, has a location URI and a set of properties
Constructors
Node | |
Fields |
Instances
Eq Node | |
Ord Node | |
Show Node | |
FromJSON Node | JSON to Node |
FromJSON FullPath | How to decodify an IdPath from JSON |
EntityIdentifier Node | |
NodeIdentifier Node | |
Entity Node | |
NodeBatchIdentifier Node | |
BatchEntity Node | |
NodeBatchIdentifier (BatchFuture Node) | |
BatchEntity (BatchFuture Node) |
getNodeProperties :: Node -> Properties Source
Get the properties of a node
nodeAPITxt :: Text Source
Constructors
NodePath | |
Fields
|
class NodeIdentifier a where Source
Methods
getNodePath :: a -> NodePath Source
runNodeIdentifier :: NodeIdentifier a => a -> ByteString Source
type RelationshipType = Text Source
Type for a relationship type description
Relationship direction
Type for a relationship location
data Relationship Source
Type for a Neo4j relationship, has a location URI, a relationship type, a starting node and a destination node
Constructors
Relationship | |
Fields
|
Instances
Eq Relationship | |
Ord Relationship | |
Show Relationship | |
FromJSON Relationship | JSON to Relationship |
FromJSON FullPath | How to decodify an IdPath from JSON |
EntityIdentifier Relationship | |
RelIdentifier Relationship | |
Entity Relationship | |
RelBatchIdentifier Relationship | |
BatchEntity Relationship | |
RelBatchIdentifier (BatchFuture Relationship) | |
BatchEntity (BatchFuture Relationship) |
getRelProperties :: Relationship -> Properties Source
Get the properties of a relationship
getRelType :: Relationship -> RelationshipType Source
Get the type of a relationship
Constructors
RelPath | |
Fields
|
class RelIdentifier a where Source
Methods
getRelPath :: a -> RelPath Source
runRelIdentifier :: RelIdentifier a => a -> ByteString Source
class EntityIdentifier a where Source
Methods
getEntityPath :: a -> EntityPath Source
Type for an index
Constructors
Index | |
Fields
|
data Neo4jException Source
Exceptions this library can raise
type Hostname = ByteString Source