Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Quad = Quad {}
- defaultCayleyConfig :: CayleyConfig
- connectCayley :: CayleyConfig -> IO CayleyConnection
- query :: CayleyConnection -> Query -> IO (Either String Value)
- data Shape
- queryShape :: CayleyConnection -> Query -> IO (Either String Shape)
- write :: CayleyConnection -> Quad -> IO (Maybe Value)
- writeQuad :: CayleyConnection -> Subject -> Predicate -> Object -> Maybe Label -> IO (Maybe Value)
- writeQuads :: CayleyConnection -> [Quad] -> IO (Maybe Value)
- writeNQuadFile :: (MonadThrow m, MonadIO m) => CayleyConnection -> FilePath -> m (Maybe Value)
- delete :: CayleyConnection -> Quad -> IO (Maybe Value)
- deleteQuad :: CayleyConnection -> Subject -> Predicate -> Object -> Maybe Label -> IO (Maybe Value)
- deleteQuads :: CayleyConnection -> [Quad] -> IO (Maybe Value)
- createQuad :: Subject -> Predicate -> Object -> Maybe Label -> Maybe Quad
- isValid :: Quad -> Bool
- results :: Maybe Value -> IO (Either String Int)
Documentation
Instances
FromJSON Quad Source # | |
Defined in Database.Cayley.Types | |
ToJSON Quad Source # | |
Generic Quad Source # | |
Show Quad Source # | |
Binary Quad Source # | |
Eq Quad Source # | Two quads are equals when subject, predicate, object and label are equals. |
type Rep Quad Source # | |
Defined in Database.Cayley.Types type Rep Quad = D1 ('MetaData "Quad" "Database.Cayley.Types" "cayley-client-0.4.19.3-DEELHK4hWB6K79WI6a0ukH" 'False) (C1 ('MetaCons "Quad" 'PrefixI 'True) ((S1 ('MetaSel ('Just "subject") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "predicate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "object") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "label") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Text))))) |
Connection
defaultCayleyConfig :: CayleyConfig Source #
CayleyConfig { serverPort = 64210 , serverName = "localhost" , apiVersion = V1 , queryLang = Gremlin }
connectCayley :: CayleyConfig -> IO CayleyConnection Source #
Get a connection to Cayley with the given configuration.
λ> conn <- connectCayley defaultCayleyConfig
Operations
query :: CayleyConnection -> Query -> IO (Either String Value) Source #
Perform a query, in Gremlin graph query language per default (or in MQL).
λ> query conn "graph.Vertex('Humphrey Bogart').In('name').All()" Right (Array (fromList [Object (fromList [("id",String "/en/humphrey_bogart")])]))
queryShape :: CayleyConnection -> Query -> IO (Either String Shape) Source #
Return the description of the given executed query.
writeQuad :: CayleyConnection -> Subject -> Predicate -> Object -> Maybe Label -> IO (Maybe Value) Source #
writeQuads :: CayleyConnection -> [Quad] -> IO (Maybe Value) Source #
Write the given list of Quad
(s).
writeNQuadFile :: (MonadThrow m, MonadIO m) => CayleyConnection -> FilePath -> m (Maybe Value) Source #
Write a N-Quad file.
λ> writeNQuadFile conn "testdata.nq" Just (Object (fromList [("result",String "Successfully wrote 11 quads.")]))
deleteQuad :: CayleyConnection -> Subject -> Predicate -> Object -> Maybe Label -> IO (Maybe Value) Source #
Delete the Quad
defined by the given subject, predicate, object
and optional label.
deleteQuads :: CayleyConnection -> [Quad] -> IO (Maybe Value) Source #
Delete the given list of Quad
(s).