Portability | FlexibleInstances, MultiParamTypeClasses |
---|---|
Stability | experimental |
Maintainer | Douglas Burke |
Composed state and IO monad for Swish
- type SwishStateIO a = StateT SwishState IO a
- data SwishState = SwishState {
- format :: SwishFormat
- base :: Maybe QName
- graph :: RDFGraph
- graphs :: NamedGraphMap
- rules :: RDFRuleMap
- rulesets :: RDFRulesetMap
- infomsg :: Maybe String
- errormsg :: Maybe String
- exitcode :: SwishStatus
- data SwishStatus
- setFormat :: SwishFormat -> SwishState -> SwishState
- setBase :: Maybe QName -> SwishState -> SwishState
- setGraph :: RDFGraph -> SwishState -> SwishState
- modGraphs :: (NamedGraphMap -> NamedGraphMap) -> SwishState -> SwishState
- findGraph :: ScopedName -> SwishState -> Maybe [RDFGraph]
- findFormula :: ScopedName -> SwishState -> Maybe RDFFormula
- modRules :: (RDFRuleMap -> RDFRuleMap) -> SwishState -> SwishState
- findRule :: ScopedName -> SwishState -> Maybe RDFRule
- modRulesets :: (RDFRulesetMap -> RDFRulesetMap) -> SwishState -> SwishState
- findRuleset :: ScopedName -> SwishState -> Maybe RDFRuleset
- findOpenVarModify :: ScopedName -> SwishState -> Maybe RDFOpenVarBindingModify
- findDatatype :: ScopedName -> SwishState -> Maybe RDFDatatype
- setInfo :: String -> SwishState -> SwishState
- resetInfo :: SwishState -> SwishState
- setError :: String -> SwishState -> SwishState
- resetError :: SwishState -> SwishState
- setStatus :: SwishStatus -> SwishState -> SwishState
- emptyState :: SwishState
- data SwishFormat
- data NamedGraph = NamedGraph {
- ngName :: ScopedName
- ngGraph :: [RDFGraph]
- type NamedGraphMap = LookupMap NamedGraph
- swishError :: String -> SwishStatus -> SwishStateIO ()
- reportLines :: [String] -> SwishStateIO ()
- reportLine :: String -> SwishStateIO ()
Documentation
type SwishStateIO a = StateT SwishState IO aSource
data SwishState Source
The State for a Swish "program".
SwishState | |
|
data SwishStatus Source
Status of the processor
SwishSuccess | successful run |
SwishGraphCompareError | graphs do not compare |
SwishDataInputError | input data problem (ie format/syntax) |
SwishDataAccessError | data access error |
SwishArgumentError | command-line argument error |
SwishExecutionError | error executing a Swish script |
setFormat :: SwishFormat -> SwishState -> SwishStateSource
setBase :: Maybe QName -> SwishState -> SwishStateSource
setGraph :: RDFGraph -> SwishState -> SwishStateSource
modGraphs :: (NamedGraphMap -> NamedGraphMap) -> SwishState -> SwishStateSource
findGraph :: ScopedName -> SwishState -> Maybe [RDFGraph]Source
findFormula :: ScopedName -> SwishState -> Maybe RDFFormulaSource
modRules :: (RDFRuleMap -> RDFRuleMap) -> SwishState -> SwishStateSource
findRule :: ScopedName -> SwishState -> Maybe RDFRuleSource
modRulesets :: (RDFRulesetMap -> RDFRulesetMap) -> SwishState -> SwishStateSource
findRuleset :: ScopedName -> SwishState -> Maybe RDFRulesetSource
setInfo :: String -> SwishState -> SwishStateSource
setError :: String -> SwishState -> SwishStateSource
setStatus :: SwishStatus -> SwishState -> SwishStateSource
data SwishFormat Source
The supported input and output formats.
data NamedGraph Source
The graphs dictionary contains named graphs and/or lists of graphs that are created and used by script statements.
NamedGraph | |
|
swishError :: String -> SwishStatus -> SwishStateIO ()Source
Report error and set exit status code
reportLines :: [String] -> SwishStateIO ()Source
Output text to the standard error stream
Each string in the supplied list is a line of text to be displayed.
reportLine :: String -> SwishStateIO ()Source