Safe Haskell | None |
---|---|
Language | Haskell98 |
The query generator DSL for SPARQL, used when connecting to remote endpoints.
- createSelectQuery :: Query SelectQuery -> String
- createConstructQuery :: Query ConstructQuery -> String
- createAskQuery :: Query AskQuery -> String
- createUpdateQuery :: Query UpdateQuery -> String
- createDescribeQuery :: Query DescribeQuery -> String
- prefix :: Text -> IRIRef -> Query Prefix
- var :: Query Variable
- triple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query Pattern
- constructTriple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query Pattern
- askTriple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query Pattern
- updateTriple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query Pattern
- describeIRI :: IRIRef -> Query IRIRef
- optional :: Query a -> Query Pattern
- union :: Query a -> Query b -> Query Pattern
- filterExpr :: TermLike a => a -> Query Pattern
- distinct :: Query Duplicates
- reduced :: Query Duplicates
- limit :: Int -> Query Limit
- orderNext :: TermLike a => a -> Query ()
- orderNextAsc :: TermLike a => a -> Query ()
- orderNextDesc :: TermLike a => a -> Query ()
- (.:.) :: Prefix -> Text -> IRIRef
- iriRef :: Text -> IRIRef
- (.+.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (.-.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (.*.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (./.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (.==.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (.!=.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (.<.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (.>.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (.<=.) :: (TermLike a, TermLike b) => a -> b -> Expr
- (.>=.) :: (TermLike a, TermLike b) => a -> b -> Expr
- notExpr :: TermLike a => a -> Expr
- str :: BuiltinFunc1
- lang :: BuiltinFunc1
- langMatches :: BuiltinFunc2
- datatype :: BuiltinFunc1
- bound :: Variable -> Expr
- sameTerm :: BuiltinFunc2
- isIRI :: BuiltinFunc1
- isURI :: BuiltinFunc1
- isBlank :: BuiltinFunc1
- isLiteral :: BuiltinFunc1
- regex :: BuiltinFunc2
- qshow :: QueryShow a => a -> String
- type Query a = State QueryData a
- data Variable
- data VarOrNode
- data Pattern
- data SelectQuery = SelectQuery {}
- data ConstructQuery = ConstructQuery {
- queryConstructs :: [Pattern]
- data AskQuery = AskQuery {}
- data UpdateQuery = UpdateQuery {
- queryUpdate :: [Pattern]
- data DescribeQuery = DescribeQuery {
- queryDescribe :: IRIRef
Creating Queries
createSelectQuery :: Query SelectQuery -> String Source #
Execute a 'Select Query' action, returning the String
representation of the query.
createConstructQuery :: Query ConstructQuery -> String Source #
Execute a 'Construct Query' action, returning the String
representation of the query.
createAskQuery :: Query AskQuery -> String Source #
Execute a 'Ask Query' action, returning the String
representation of the query.
createUpdateQuery :: Query UpdateQuery -> String Source #
Execute a 'Update Query' action, returning the String
representation of the query.
createDescribeQuery :: Query DescribeQuery -> String Source #
Execute a 'Describe Query' action, returning the String
representation of the query.
Query Actions
prefix :: Text -> IRIRef -> Query Prefix Source #
Add a prefix to the query, given an IRI reference, and return it.
var :: Query Variable Source #
Create and return a variable to the query, usable in later expressions.
triple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query Pattern Source #
Restrict the query to only results for which values match constants in this triple, or for which the variables can be bound.
constructTriple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query Pattern Source #
updateTriple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query Pattern Source #
describeIRI :: IRIRef -> Query IRIRef Source #
optional :: Query a -> Query Pattern Source #
Add optional constraints on matches. Variable bindings within the optional action are lost, so variables must always be defined prior to opening the optional block.
union :: Query a -> Query b -> Query Pattern Source #
Add a union structure to the query pattern. As with optional
blocks,
variables must be defined prior to the opening of any block.
filterExpr :: TermLike a => a -> Query Pattern Source #
Restrict results to only those for which the given expression is true.
Duplicate handling
distinct :: Query Duplicates Source #
Set duplicate handling to Distinct
. By default, there are no reductions.
reduced :: Query Duplicates Source #
Set duplicate handling to Reduced
. By default, there are no reductions.
Limit handling
limit :: Int -> Query Limit Source #
Set limit handling to the given value. By default, there are no limits. Note: negative numbers cause no query results to be returned.
Order handling
orderNext :: TermLike a => a -> Query () Source #
Alias of orderNextAsc
.
orderNextAsc :: TermLike a => a -> Query () Source #
Order the results, after any previous ordering, based on the term, in ascending order.
orderNextDesc :: TermLike a => a -> Query () Source #
Order the results, after any previous ordering, based on the term, in descending order.
Auxiliary
Term Manipulation
Operations
Relations
(.==.) :: (TermLike a, TermLike b) => a -> b -> Expr Source #
Create an expression which tests the relationship of the two operands, evaluating their equivalence.
(.!=.) :: (TermLike a, TermLike b) => a -> b -> Expr Source #
Create an expression which tests the relationship of the two operands, evaluating their equivalence.
(.<.) :: (TermLike a, TermLike b) => a -> b -> Expr Source #
Create an expression which tests the relationship of the two operands, evaluating their relative value.
(.>.) :: (TermLike a, TermLike b) => a -> b -> Expr Source #
Create an expression which tests the relationship of the two operands, evaluating their relative value.
(.<=.) :: (TermLike a, TermLike b) => a -> b -> Expr Source #
Create an expression which tests the relationship of the two operands, evaluating their relative value.
(.>=.) :: (TermLike a, TermLike b) => a -> b -> Expr Source #
Create an expression which tests the relationship of the two operands, evaluating their relative value.
Negation
notExpr :: TermLike a => a -> Expr Source #
Negate any term-like expression, for use, e.g., in filtering.
Builtin Functions
langMatches :: BuiltinFunc2 Source #
Printing Queries
qshow :: QueryShow a => a -> String Source #
Convert most query-related types to a String
, most importantly
QueryData
s.
Types
Enables programmatic construction of triples where it is not known in
advance which parts of the triple will be variables and which will be
Node
s.
data UpdateQuery Source #
data DescribeQuery Source #
DescribeQuery | |
|