The query generator DSL for SPARQL, used when connecting to remote endpoints.
- createQuery :: Query [Variable] -> String
- prefix :: IRIRef -> Query Prefix
- var :: Query Variable
- triple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query Pattern
- optional :: Query a -> Query Pattern
- union :: Query a -> Query b -> Query Pattern
- filterExpr :: TermLike a => a -> Query Pattern
- distinct :: Query Duplicates
- reduced :: Query Duplicates
- orderNext :: TermLike a => a -> Query ()
- orderNextAsc :: TermLike a => a -> Query ()
- orderNextDesc :: TermLike a => a -> Query ()
- (.:.) :: Prefix -> String -> IRIRef
- iriRef :: String -> 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
Creating Queries
createQuery :: Query [Variable] -> StringSource
Query Actions
prefix :: IRIRef -> Query PrefixSource
Add a prefix to the query, given an IRI reference, and return it.
triple :: (TermLike a, TermLike b, TermLike c) => a -> b -> c -> Query PatternSource
Restrict the query to only results for which values match constants in this triple, or for which the variables can be bound.
optional :: Query a -> Query PatternSource
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 PatternSource
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 PatternSource
Restrict results to only those for which the given expression is true.
Duplicate handling
distinct :: Query DuplicatesSource
Set duplicate handling to Distinct
. By default, there are no reductions.
reduced :: Query DuplicatesSource
Set duplicate handling to Reduced
. By default, there are no reductions.
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
(.:.) :: Prefix -> String -> IRIRefSource
Form a PrefixedName
IRIRef
, with the Prefix
and reference name.
iriRef :: String -> IRIRefSource
Create an IRIRef
with an absolute reference to the address at which it is
located.
Term Manipulation
Operations
Relations
(.==.) :: (TermLike a, TermLike b) => a -> b -> ExprSource
Create an expression which tests the relationship of the two operands, evaluating their equivalence.
(.!=.) :: (TermLike a, TermLike b) => a -> b -> ExprSource
Create an expression which tests the relationship of the two operands, evaluating their equivalence.
(.<.) :: (TermLike a, TermLike b) => a -> b -> ExprSource
Create an expression which tests the relationship of the two operands, evaluating their relative value.
(.>.) :: (TermLike a, TermLike b) => a -> b -> ExprSource
Create an expression which tests the relationship of the two operands, evaluating their relative value.
(.<=.) :: (TermLike a, TermLike b) => a -> b -> ExprSource
Create an expression which tests the relationship of the two operands, evaluating their relative value.
(.>=.) :: (TermLike a, TermLike b) => a -> b -> ExprSource
Create an expression which tests the relationship of the two operands, evaluating their relative value.
Negation
notExpr :: TermLike a => a -> ExprSource
Negate any term-like expression, for use, e.g., in filtering.
Builtin Functions
langMatches :: BuiltinFunc2Source
Printing Queries
qshow :: QueryShow a => a -> StringSource
Convert most query-related types to a String
, most importantly
QueryData
s.