Maintainer | Toshio Ito <[email protected]> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Data.Greskell.Graph
Description
This module defines types and functions about TinkerPop graph structure API.
Synopsis
- class ElementData e => Element e where
- type ElementProperty e :: Type -> Type
- type ElementPropertyContainer e :: Type -> Type
- class ElementData e where
- elementId :: e -> ElementID e
- elementLabel :: e -> Text
- newtype ElementID e = ElementID {}
- unsafeCastElementID :: ElementID a -> ElementID b
- class Element v => Vertex v
- class Element e => Edge e
- class Property (p :: Type -> Type) where
- propertyKey :: p v -> Text
- propertyValue :: p v -> v
- data T a b
- tId :: Element a => Greskell (T a (ElementID a))
- tKey :: (Element (p v), Property p) => Greskell (T (p v) Text)
- tLabel :: Element a => Greskell (T a Text)
- tValue :: (Element (p v), Property p) => Greskell (T (p v) v)
- data Cardinality
- cList :: Greskell Cardinality
- cSet :: Greskell Cardinality
- cSingle :: Greskell Cardinality
- newtype Key a b = Key {}
- key :: Text -> Key a b
- unsafeCastKey :: Key a1 b1 -> Key a2 b2
- data KeyValue a where
- (=:) :: Key a b -> Greskell b -> KeyValue a
- data Keys a where
- singletonKeys :: Key a b -> Keys a
- toGremlinKeys :: Keys a -> [Text]
- (-:) :: Key a b -> Keys a -> Keys a
- newtype Path a = Path {}
- data PathEntry a = PathEntry {}
- pathToPMap :: Path a -> PMap Multi a
- makePathEntry :: [AsLabel a] -> a -> PathEntry a
- data AVertex = AVertex {}
- data AEdge = AEdge {}
- data AVertexProperty v = AVertexProperty {}
- data AProperty v = AProperty {}
- examples :: [(Text, Text)]
Element
class ElementData e => Element e Source #
org.apache.tinkerpop.gremlin.structure.Element
interface in a
TinkerPop graph.
Since greskell-1.0.0.0, ElementData
is a super-class of
Element
.
Associated Types
type ElementProperty e :: Type -> Type Source #
type ElementPropertyContainer e :: Type -> Type Source #
Container type of the properties of the Element
. It should be
of NonEmptyLike
class.
Since: 1.0.0.0
Instances
Element AEdge Source # | |||||||||
Defined in Data.Greskell.Graph Associated Types
| |||||||||
Element AVertex Source # | |||||||||
Defined in Data.Greskell.Graph Associated Types
| |||||||||
Element (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph Associated Types
|
class ElementData e where Source #
Types that keep reference to TinkerPop graph Elements.
Since: 1.0.0.0
Methods
elementId :: e -> ElementID e Source #
ID of this Element.
elementLabel :: e -> Text Source #
Label of this Element.
Instances
ElementData AEdge Source # | Since: 1.0.0.0 |
ElementData AVertex Source # | Since: 1.0.0.0 |
ElementData (AVertexProperty v) Source # | Since: 1.0.0.0 |
Defined in Data.Greskell.Graph Methods elementId :: AVertexProperty v -> ElementID (AVertexProperty v) Source # elementLabel :: AVertexProperty v -> Text Source # |
ID of a graph element e
(vertex, edge and vertex property).
Although the internal of ElementID
is exposed, you should treat it as an opaque value. That's
because it depends on graph implementation.
Since: 1.0.0.0
Constructors
ElementID | |
Fields |
Instances
Functor ElementID Source # | Unsafely convert the element type. | ||||
FromJSON (ElementID e) Source # | |||||
Defined in Data.Greskell.Graph | |||||
ToJSON (ElementID e) Source # | |||||
Generic (ElementID e) Source # | |||||
Defined in Data.Greskell.Graph Associated Types
| |||||
Show (ElementID e) Source # | |||||
Eq (ElementID e) Source # | |||||
FromGraphSON (ElementID e) Source # | |||||
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser (ElementID e) # | |||||
Hashable (ElementID e) Source # | |||||
Defined in Data.Greskell.Graph | |||||
type Rep (ElementID e) Source # | |||||
Defined in Data.Greskell.Graph |
unsafeCastElementID :: ElementID a -> ElementID b Source #
Unsafely cast the phantom type of ElementID
.
Since: 1.0.0.0
class Element v => Vertex v Source #
org.apache.tinkerpop.gremlin.structure.Vertex
interface in a
TinkerPop graph.
Instances
Vertex AVertex Source # | |
Defined in Data.Greskell.Graph |
class Element e => Edge e Source #
org.apache.tinkerpop.gremlin.structure.Edge
interface in a
TinkerPop graph.
Instances
Edge AEdge Source # | |
Defined in Data.Greskell.Graph |
Property
class Property (p :: Type -> Type) where Source #
org.apache.tinkerpop.gremlin.structure.Property
interface in a
TinkerPop graph.
Methods
propertyKey :: p v -> Text Source #
Get key of this property.
propertyValue :: p v -> v Source #
Get value of this property.
Instances
Property AProperty Source # | |
Defined in Data.Greskell.Graph | |
Property AVertexProperty Source # | |
Defined in Data.Greskell.Graph Methods propertyKey :: AVertexProperty v -> Text Source # propertyValue :: AVertexProperty v -> v Source # |
T Enum
org.apache.tinkerpop.gremlin.structure.T
enum.
T
is a token to get data b
from an Element a
.
Instances
ProjectionLike (Greskell (T s e)) Source # | |||||||||
Defined in Data.Greskell.GTraversal Associated Types
| |||||||||
GraphSONTyped (T a b) Source # | |||||||||
Defined in Data.Greskell.Graph Methods gsonTypeFor :: T a b -> Text # | |||||||||
type ProjectionLikeEnd (Greskell (T s e)) Source # | |||||||||
Defined in Data.Greskell.GTraversal | |||||||||
type ProjectionLikeStart (Greskell (T s e)) Source # | |||||||||
Defined in Data.Greskell.GTraversal |
Cardinality Enum
data Cardinality Source #
org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality
enum.
Since: 0.2.0.0
cList :: Greskell Cardinality Source #
list
Cardinality.
Since: 0.2.0.0
cSet :: Greskell Cardinality Source #
set
Cardinality.
Since: 0.2.0.0
cSingle :: Greskell Cardinality Source #
single
Cardinality.
Since: 0.2.0.0
Typed Key (accessor of a Property)
A property key accessing value b
in an Element a
. In Gremlin,
it's just a String type.
Since greskell-1.0.0.0, Key
is newtype of Text
. Before that, it
was newtype of Greskell
Text
.
Instances
unsafeCastKey :: Key a1 b1 -> Key a2 b2 Source #
Unsafely cast the type signature of the Key
.
Since: 1.0.0.0
Key-value pair
Heterogeneous list of keys
Heterogeneous list of Key
s. It keeps the parent type a
, but
discards the value type b
.
Since: 1.0.0.0
Constructors
KeysNil :: forall a. Keys a | Empty |
KeysCons :: forall a b. Key a b -> Keys a -> Keys a |
Path
org.apache.tinkerpop.gremlin.process.traversal.Path
interface.
Since: 1.1.0.0
Instances
Functor Path Source # | |||||
Foldable Path Source # | |||||
Defined in Data.Greskell.Graph Methods fold :: Monoid m => Path m -> m # foldMap :: Monoid m => (a -> m) -> Path a -> m # foldMap' :: Monoid m => (a -> m) -> Path a -> m # foldr :: (a -> b -> b) -> b -> Path a -> b # foldr' :: (a -> b -> b) -> b -> Path a -> b # foldl :: (b -> a -> b) -> b -> Path a -> b # foldl' :: (b -> a -> b) -> b -> Path a -> b # foldr1 :: (a -> a -> a) -> Path a -> a # foldl1 :: (a -> a -> a) -> Path a -> a # elem :: Eq a => a -> Path a -> Bool # maximum :: Ord a => Path a -> a # | |||||
Traversable Path Source # | |||||
FromGraphSON a => FromJSON (Path a) Source # | |||||
Defined in Data.Greskell.Graph | |||||
Monoid (Path a) Source # | |||||
Semigroup (Path a) Source # | |||||
Show a => Show (Path a) Source # | |||||
Eq a => Eq (Path a) Source # | |||||
Ord a => Ord (Path a) Source # | |||||
AsIterator (Path a) Source # |
| ||||
Defined in Data.Greskell.Graph Associated Types
| |||||
FromGraphSON a => FromGraphSON (Path a) Source # | |||||
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser (Path a) # | |||||
GraphSONTyped (Path a) Source # | |||||
Defined in Data.Greskell.Graph Methods gsonTypeFor :: Path a -> Text # | |||||
type IteratorItem (Path a) Source # | |||||
Defined in Data.Greskell.Graph |
An entry in a Path
.
Since: 1.1.0.0
Instances
Functor PathEntry Source # | |
Foldable PathEntry Source # | |
Defined in Data.Greskell.Graph Methods fold :: Monoid m => PathEntry m -> m # foldMap :: Monoid m => (a -> m) -> PathEntry a -> m # foldMap' :: Monoid m => (a -> m) -> PathEntry a -> m # foldr :: (a -> b -> b) -> b -> PathEntry a -> b # foldr' :: (a -> b -> b) -> b -> PathEntry a -> b # foldl :: (b -> a -> b) -> b -> PathEntry a -> b # foldl' :: (b -> a -> b) -> b -> PathEntry a -> b # foldr1 :: (a -> a -> a) -> PathEntry a -> a # foldl1 :: (a -> a -> a) -> PathEntry a -> a # toList :: PathEntry a -> [a] # length :: PathEntry a -> Int # elem :: Eq a => a -> PathEntry a -> Bool # maximum :: Ord a => PathEntry a -> a # minimum :: Ord a => PathEntry a -> a # | |
Traversable PathEntry Source # | |
Defined in Data.Greskell.Graph | |
Show a => Show (PathEntry a) Source # | |
Eq a => Eq (PathEntry a) Source # | |
Ord a => Ord (PathEntry a) Source # | |
Defined in Data.Greskell.Graph |
Make a PathEntry
.
Since: 1.1.0.0
Concrete data types
Graph structure data types based on Aeson.
You can use those types directly in your programs. You can also
define your own graph types by wrapping those with newtype
. See
README.md
for detail.
Historical note:
General vertex type you can use for Vertex
class.
Constructors
AVertex | |
Instances
FromJSON AVertex Source # | |||||||||
Defined in Data.Greskell.Graph | |||||||||
Show AVertex Source # | |||||||||
Eq AVertex Source # | |||||||||
Element AVertex Source # | |||||||||
Defined in Data.Greskell.Graph Associated Types
| |||||||||
ElementData AVertex Source # | Since: 1.0.0.0 | ||||||||
Vertex AVertex Source # | |||||||||
Defined in Data.Greskell.Graph | |||||||||
FromGraphSON AVertex Source # | |||||||||
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser AVertex # | |||||||||
GraphSONTyped AVertex Source # | |||||||||
Defined in Data.Greskell.Graph Methods gsonTypeFor :: AVertex -> Text # | |||||||||
type ElementProperty AVertex Source # | |||||||||
Defined in Data.Greskell.Graph | |||||||||
type ElementPropertyContainer AVertex Source # | |||||||||
Defined in Data.Greskell.Graph |
Edge
General edge type you can use for Edge
class.
Instances
FromJSON AEdge Source # | |||||||||
Defined in Data.Greskell.Graph | |||||||||
Show AEdge Source # | |||||||||
Eq AEdge Source # | |||||||||
Edge AEdge Source # | |||||||||
Defined in Data.Greskell.Graph | |||||||||
Element AEdge Source # | |||||||||
Defined in Data.Greskell.Graph Associated Types
| |||||||||
ElementData AEdge Source # | Since: 1.0.0.0 | ||||||||
FromGraphSON AEdge Source # | |||||||||
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser AEdge # | |||||||||
GraphSONTyped AEdge Source # | |||||||||
Defined in Data.Greskell.Graph Methods gsonTypeFor :: AEdge -> Text # | |||||||||
type ElementProperty AEdge Source # | |||||||||
Defined in Data.Greskell.Graph | |||||||||
type ElementPropertyContainer AEdge Source # | |||||||||
Defined in Data.Greskell.Graph |
VertexProperty
data AVertexProperty v Source #
General vertex property type you can use for VertexProperty.
If you are not sure about the type v
, just use GValue
.
Constructors
AVertexProperty | |
Instances
Functor AVertexProperty Source # | Map the property value. | ||||||||
Defined in Data.Greskell.Graph Methods fmap :: (a -> b) -> AVertexProperty a -> AVertexProperty b # (<$) :: a -> AVertexProperty b -> AVertexProperty a # | |||||||||
Foldable AVertexProperty Source # | |||||||||
Defined in Data.Greskell.Graph Methods fold :: Monoid m => AVertexProperty m -> m # foldMap :: Monoid m => (a -> m) -> AVertexProperty a -> m # foldMap' :: Monoid m => (a -> m) -> AVertexProperty a -> m # foldr :: (a -> b -> b) -> b -> AVertexProperty a -> b # foldr' :: (a -> b -> b) -> b -> AVertexProperty a -> b # foldl :: (b -> a -> b) -> b -> AVertexProperty a -> b # foldl' :: (b -> a -> b) -> b -> AVertexProperty a -> b # foldr1 :: (a -> a -> a) -> AVertexProperty a -> a # foldl1 :: (a -> a -> a) -> AVertexProperty a -> a # toList :: AVertexProperty a -> [a] # null :: AVertexProperty a -> Bool # length :: AVertexProperty a -> Int # elem :: Eq a => a -> AVertexProperty a -> Bool # maximum :: Ord a => AVertexProperty a -> a # minimum :: Ord a => AVertexProperty a -> a # sum :: Num a => AVertexProperty a -> a # product :: Num a => AVertexProperty a -> a # | |||||||||
Traversable AVertexProperty Source # | Traverse the property value. | ||||||||
Defined in Data.Greskell.Graph Methods traverse :: Applicative f => (a -> f b) -> AVertexProperty a -> f (AVertexProperty b) # sequenceA :: Applicative f => AVertexProperty (f a) -> f (AVertexProperty a) # mapM :: Monad m => (a -> m b) -> AVertexProperty a -> m (AVertexProperty b) # sequence :: Monad m => AVertexProperty (m a) -> m (AVertexProperty a) # | |||||||||
Property AVertexProperty Source # | |||||||||
Defined in Data.Greskell.Graph Methods propertyKey :: AVertexProperty v -> Text Source # propertyValue :: AVertexProperty v -> v Source # | |||||||||
FromGraphSON v => FromJSON (AVertexProperty v) Source # | In version 0.1.1.0 and before, the constraint was | ||||||||
Defined in Data.Greskell.Graph Methods parseJSON :: Value -> Parser (AVertexProperty v) # parseJSONList :: Value -> Parser [AVertexProperty v] # omittedField :: Maybe (AVertexProperty v) # | |||||||||
Show v => Show (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph Methods showsPrec :: Int -> AVertexProperty v -> ShowS # show :: AVertexProperty v -> String # showList :: [AVertexProperty v] -> ShowS # | |||||||||
Eq v => Eq (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph Methods (==) :: AVertexProperty v -> AVertexProperty v -> Bool # (/=) :: AVertexProperty v -> AVertexProperty v -> Bool # | |||||||||
Element (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph Associated Types
| |||||||||
ElementData (AVertexProperty v) Source # | Since: 1.0.0.0 | ||||||||
Defined in Data.Greskell.Graph Methods elementId :: AVertexProperty v -> ElementID (AVertexProperty v) Source # elementLabel :: AVertexProperty v -> Text Source # | |||||||||
FromGraphSON v => FromGraphSONWithKey (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph.PropertyMap Methods parseGraphSONWithKey :: Text -> GValue -> Parser (AVertexProperty v) | |||||||||
FromGraphSON v => FromGraphSON (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser (AVertexProperty v) # | |||||||||
GraphSONTyped (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph Methods gsonTypeFor :: AVertexProperty v -> Text # | |||||||||
type ElementProperty (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph | |||||||||
type ElementPropertyContainer (AVertexProperty v) Source # | |||||||||
Defined in Data.Greskell.Graph |
Property
General simple property type you can use for Property
class.
If you are not sure about the type v
, just use GValue
.
Instances
Functor AProperty Source # | |
Foldable AProperty Source # | |
Defined in Data.Greskell.Graph Methods fold :: Monoid m => AProperty m -> m # foldMap :: Monoid m => (a -> m) -> AProperty a -> m # foldMap' :: Monoid m => (a -> m) -> AProperty a -> m # foldr :: (a -> b -> b) -> b -> AProperty a -> b # foldr' :: (a -> b -> b) -> b -> AProperty a -> b # foldl :: (b -> a -> b) -> b -> AProperty a -> b # foldl' :: (b -> a -> b) -> b -> AProperty a -> b # foldr1 :: (a -> a -> a) -> AProperty a -> a # foldl1 :: (a -> a -> a) -> AProperty a -> a # toList :: AProperty a -> [a] # length :: AProperty a -> Int # elem :: Eq a => a -> AProperty a -> Bool # maximum :: Ord a => AProperty a -> a # minimum :: Ord a => AProperty a -> a # | |
Traversable AProperty Source # | |
Defined in Data.Greskell.Graph | |
Property AProperty Source # | |
Defined in Data.Greskell.Graph | |
FromGraphSON v => FromJSON (AProperty v) Source # | Parse Property of GraphSON 1.0. In version 0.1.1.0 and before, the constraint was |
Defined in Data.Greskell.Graph | |
Show v => Show (AProperty v) Source # | |
Eq v => Eq (AProperty v) Source # | |
Ord v => Ord (AProperty v) Source # | |
Defined in Data.Greskell.Graph | |
FromGraphSON v => FromGraphSONWithKey (AProperty v) Source # | |
Defined in Data.Greskell.Graph.PropertyMap Methods parseGraphSONWithKey :: Text -> GValue -> Parser (AProperty v) | |
FromGraphSON v => FromGraphSON (AProperty v) Source # | Parse Property of GraphSON 1.0. |
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser (AProperty v) # | |
GraphSONTyped (AProperty v) Source # | |
Defined in Data.Greskell.Graph Methods gsonTypeFor :: AProperty v -> Text # |