Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This module defines types and functions about TinkerPop graph structure API.
Synopsis
- class ElementData e => Element e where
- type ElementProperty e :: * -> *
- type ElementPropertyContainer e :: * -> *
- 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 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
- (-:) :: 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 {}
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
.
type ElementProperty e :: * -> * Source #
type ElementPropertyContainer e :: * -> * 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 | |
Element AVertex Source # | |
Defined in Data.Greskell.Graph | |
Element (AVertexProperty v) Source # | |
Defined in Data.Greskell.Graph type ElementProperty (AVertexProperty v) :: Type -> Type Source # type ElementPropertyContainer (AVertexProperty v) :: Type -> Type Source # |
class ElementData e where Source #
Types that keep reference to TinkerPop graph Elements.
Since: 1.0.0.0
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 elementId :: AVertexProperty v -> ElementID (AVertexProperty v) Source # elementLabel :: AVertexProperty v -> Text Source # |
ID of a graph element e
(vertex, edge and vertex property).
Since: 1.0.0.0
ElementID | |
|
Instances
Functor ElementID Source # | Unsafely convert the element type. |
Eq (ElementID e) Source # | |
Show (ElementID e) Source # | |
Generic (ElementID e) Source # | |
Hashable (ElementID e) Source # | |
Defined in Data.Greskell.Graph | |
ToJSON (ElementID e) Source # | |
Defined in Data.Greskell.Graph | |
FromJSON (ElementID e) Source # | |
FromGraphSON (ElementID e) Source # | |
Defined in Data.Greskell.Graph parseGraphSON :: GValue -> Parser (ElementID e) # | |
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 where Source #
org.apache.tinkerpop.gremlin.structure.Property
interface in a
TinkerPop graph.
propertyKey :: p v -> Text Source #
Get key of this property.
propertyValue :: p v -> v Source #
Get value of this property.
Instances
Property AVertexProperty Source # | |
Defined in Data.Greskell.Graph propertyKey :: AVertexProperty v -> Text Source # propertyValue :: AVertexProperty v -> v Source # | |
Property AProperty Source # | |
Defined in Data.Greskell.Graph propertyKey :: AProperty v -> Text Source # propertyValue :: AProperty 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 | |
GraphSONTyped (T a b) Source # | |
Defined in Data.Greskell.Graph gsonTypeFor :: T a b -> Text # | |
type ProjectionLikeStart (Greskell (T s e)) Source # | |
Defined in Data.Greskell.GTraversal | |
type ProjectionLikeEnd (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.
>>>
toGremlin cList
"list"
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.
>>>
toGremlin ("age" :: Key AVertex Int)
"\"age\"">>>
toGremlin (key "created_at" :: Key AEdge Text)
"\"created_at\"">>>
keyText ("name" :: Key AVertex Text)
"name"
Since greskell-1.0.0.0, Key
is newtype of Text
. Before that, it
was newtype of Greskell
Text
.
Instances
Functor (Key a) Source # | Unsafely convert the value type |
Eq (Key a b) Source # | |
Show (Key a b) Source # | |
IsString (Key a b) Source # | |
Defined in Data.Greskell.Graph fromString :: String -> Key a b # | |
ToGreskell (Key a b) Source # | Return Gremlin String literal. |
Defined in Data.Greskell.Graph type GreskellReturn (Key a b) :: Type # toGreskell :: Key a b -> Greskell (GreskellReturn (Key a b)) # | |
PMapKey (Key a b) Source # | Since: 1.0.0.0 |
ProjectionLike (Key s e) Source # | |
Defined in Data.Greskell.GTraversal type ProjectionLikeStart (Key s e) :: Type Source # type ProjectionLikeEnd (Key s e) :: Type Source # | |
type GreskellReturn (Key a b) Source # | |
Defined in Data.Greskell.Graph | |
type PMapValue (Key a b) Source # | |
Defined in Data.Greskell.Graph | |
type ProjectionLikeStart (Key s e) Source # | |
Defined in Data.Greskell.GTraversal | |
type ProjectionLikeEnd (Key s e) Source # | |
Defined in Data.Greskell.GTraversal |
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
Path
org.apache.tinkerpop.gremlin.process.traversal.Path
interface.
Since: 1.1.0.0
Instances
An entry in a Path
.
Since: 1.1.0.0
Instances
Functor PathEntry Source # | |
Foldable PathEntry Source # | |
Defined in Data.Greskell.Graph fold :: Monoid m => PathEntry m -> 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 # | |
Eq a => Eq (PathEntry a) Source # | |
Ord a => Ord (PathEntry a) Source # | |
Defined in Data.Greskell.Graph | |
Show a => Show (PathEntry a) Source # | |
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:
Vertex
General vertex type you can use for Vertex
class.
Instances
Eq AVertex Source # | |
Show AVertex Source # | |
FromJSON AVertex Source # | |
FromGraphSON AVertex Source # | |
Defined in Data.Greskell.Graph parseGraphSON :: GValue -> Parser AVertex # | |
GraphSONTyped AVertex Source # | |
Defined in Data.Greskell.Graph gsonTypeFor :: AVertex -> Text # | |
Vertex AVertex Source # | |
Defined in Data.Greskell.Graph | |
Element AVertex Source # | |
Defined in Data.Greskell.Graph | |
ElementData AVertex Source # | Since: 1.0.0.0 |
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
Eq AEdge Source # | |
Show AEdge Source # | |
FromJSON AEdge Source # | |
FromGraphSON AEdge Source # | |
Defined in Data.Greskell.Graph parseGraphSON :: GValue -> Parser AEdge # | |
GraphSONTyped AEdge Source # | |
Defined in Data.Greskell.Graph gsonTypeFor :: AEdge -> Text # | |
Edge AEdge Source # | |
Defined in Data.Greskell.Graph | |
Element AEdge Source # | |
Defined in Data.Greskell.Graph | |
ElementData AEdge Source # | Since: 1.0.0.0 |
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
.
Instances
Property
General simple property type you can use for Property
class.
If you are not sure about the type v
, just use GValue
.