hydra-0.5.1: Type-aware transformations for data and programs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hydra.Query

Description

A model for language-agnostic graph pattern queries

Synopsis

Documentation

data ComparisonConstraint Source #

One of several comparison operators

data Edge Source #

An abstract edge based on a record type

Constructors

Edge 

Fields

  • edgeType :: Name

    The name of a record type, for which the edge also specifies an out- and an in- projection

  • edgeOut :: Maybe Name

    The field representing the out-projection of the edge. Defaults to out.

  • edgeIn :: Maybe Name

    The field representing the in-projection of the edge. Defaults to 'in'.

Instances

Instances details
Read Edge Source # 
Instance details

Defined in Hydra.Query

Show Edge Source # 
Instance details

Defined in Hydra.Query

Methods

showsPrec :: Int -> Edge -> ShowS #

show :: Edge -> String #

showList :: [Edge] -> ShowS #

Eq Edge Source # 
Instance details

Defined in Hydra.Query

Methods

(==) :: Edge -> Edge -> Bool #

(/=) :: Edge -> Edge -> Bool #

Ord Edge Source # 
Instance details

Defined in Hydra.Query

Methods

compare :: Edge -> Edge -> Ordering #

(<) :: Edge -> Edge -> Bool #

(<=) :: Edge -> Edge -> Bool #

(>) :: Edge -> Edge -> Bool #

(>=) :: Edge -> Edge -> Bool #

max :: Edge -> Edge -> Edge #

min :: Edge -> Edge -> Edge #

data GraphPattern Source #

A query pattern which matches within a designated component subgraph

Constructors

GraphPattern 

Fields

data Node Source #

A node in a query expression; it may be a term, a variable, or a wildcard

Constructors

NodeTerm Term

A graph term; an expression which is valid in the graph being matched

NodeVariable Variable

A query variable, not to be confused with a variable term

NodeWildcard

An anonymous variable which we do not care to join across patterns

Instances

Instances details
Read Node Source # 
Instance details

Defined in Hydra.Query

Show Node Source # 
Instance details

Defined in Hydra.Query

Methods

showsPrec :: Int -> Node -> ShowS #

show :: Node -> String #

showList :: [Node] -> ShowS #

Eq Node Source # 
Instance details

Defined in Hydra.Query

Methods

(==) :: Node -> Node -> Bool #

(/=) :: Node -> Node -> Bool #

Ord Node Source # 
Instance details

Defined in Hydra.Query

Methods

compare :: Node -> Node -> Ordering #

(<) :: Node -> Node -> Bool #

(<=) :: Node -> Node -> Bool #

(>) :: Node -> Node -> Bool #

(>=) :: Node -> Node -> Bool #

max :: Node -> Node -> Node #

min :: Node -> Node -> Node #

data Path Source #

A query path

Constructors

PathStep Step

A path given by a single step

PathRegex RegexSequence

A path given by a regular expression quantifier applied to another path

PathInverse Path

A path given by the inverse of another path

Instances

Instances details
Read Path Source # 
Instance details

Defined in Hydra.Query

Show Path Source # 
Instance details

Defined in Hydra.Query

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

Eq Path Source # 
Instance details

Defined in Hydra.Query

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

Ord Path Source # 
Instance details

Defined in Hydra.Query

Methods

compare :: Path -> Path -> Ordering #

(<) :: Path -> Path -> Bool #

(<=) :: Path -> Path -> Bool #

(>) :: Path -> Path -> Bool #

(>=) :: Path -> Path -> Bool #

max :: Path -> Path -> Path #

min :: Path -> Path -> Path #

data Pattern Source #

A query pattern

Constructors

PatternTriple TriplePattern

A subjectpredicateobject pattern

PatternNegation Pattern

The negation of another pattern

PatternConjunction [Pattern]

The conjunction (and) of several other patterns

PatternDisjunction [Pattern]

The disjunction (inclusive or) of several other patterns

PatternGraph GraphPattern

A pattern which matches within a named subgraph

Instances

Instances details
Read Pattern Source # 
Instance details

Defined in Hydra.Query

Show Pattern Source # 
Instance details

Defined in Hydra.Query

Eq Pattern Source # 
Instance details

Defined in Hydra.Query

Methods

(==) :: Pattern -> Pattern -> Bool #

(/=) :: Pattern -> Pattern -> Bool #

Ord Pattern Source # 
Instance details

Defined in Hydra.Query

data Query Source #

A SELECT-style graph pattern matching query

Constructors

Query 

Fields

Instances

Instances details
Read Query Source # 
Instance details

Defined in Hydra.Query

Show Query Source # 
Instance details

Defined in Hydra.Query

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

Eq Query Source # 
Instance details

Defined in Hydra.Query

Methods

(==) :: Query -> Query -> Bool #

(/=) :: Query -> Query -> Bool #

Ord Query Source # 
Instance details

Defined in Hydra.Query

Methods

compare :: Query -> Query -> Ordering #

(<) :: Query -> Query -> Bool #

(<=) :: Query -> Query -> Bool #

(>) :: Query -> Query -> Bool #

(>=) :: Query -> Query -> Bool #

max :: Query -> Query -> Query #

min :: Query -> Query -> Query #

data Range Source #

A range from min to max, inclusive

Constructors

Range 

Fields

Instances

Instances details
Read Range Source # 
Instance details

Defined in Hydra.Query

Show Range Source # 
Instance details

Defined in Hydra.Query

Methods

showsPrec :: Int -> Range -> ShowS #

show :: Range -> String #

showList :: [Range] -> ShowS #

Eq Range Source # 
Instance details

Defined in Hydra.Query

Methods

(==) :: Range -> Range -> Bool #

(/=) :: Range -> Range -> Bool #

Ord Range Source # 
Instance details

Defined in Hydra.Query

Methods

compare :: Range -> Range -> Ordering #

(<) :: Range -> Range -> Bool #

(<=) :: Range -> Range -> Bool #

(>) :: Range -> Range -> Bool #

(>=) :: Range -> Range -> Bool #

max :: Range -> Range -> Range #

min :: Range -> Range -> Range #

data RegexQuantifier Source #

A regular expression quantifier

Constructors

RegexQuantifierOne

No quantifier; matches a single occurrence

RegexQuantifierZeroOrOne

The ? quanifier; matches zero or one occurrence

RegexQuantifierZeroOrMore

The * quantifier; matches any number of occurrences

RegexQuantifierOneOrMore

The + quantifier; matches one or more occurrences

RegexQuantifierExactly Int

The {n} quantifier; matches exactly n occurrences

RegexQuantifierAtLeast Int

The {n,} quantifier; matches at least n occurrences

RegexQuantifierRange Range

The {n, m} quantifier; matches between n and m (inclusive) occurrences

data Step Source #

An atomic function as part of a query. When applied to a graph, steps are typed by function types.

Constructors

StepEdge Edge

An out-to-in traversal of an abstract edge

StepProject Projection

A projection from a record through one of its fields

StepCompare ComparisonConstraint

A comparison of two terms

Instances

Instances details
Read Step Source # 
Instance details

Defined in Hydra.Query

Show Step Source # 
Instance details

Defined in Hydra.Query

Methods

showsPrec :: Int -> Step -> ShowS #

show :: Step -> String #

showList :: [Step] -> ShowS #

Eq Step Source # 
Instance details

Defined in Hydra.Query

Methods

(==) :: Step -> Step -> Bool #

(/=) :: Step -> Step -> Bool #

Ord Step Source # 
Instance details

Defined in Hydra.Query

Methods

compare :: Step -> Step -> Ordering #

(<) :: Step -> Step -> Bool #

(<=) :: Step -> Step -> Bool #

(>) :: Step -> Step -> Bool #

(>=) :: Step -> Step -> Bool #

max :: Step -> Step -> Step #

min :: Step -> Step -> Step #

newtype Variable Source #

A query variable

Constructors

Variable 

Fields

Instances

Instances details
Read Variable Source # 
Instance details

Defined in Hydra.Query

Show Variable Source # 
Instance details

Defined in Hydra.Query

Eq Variable Source # 
Instance details

Defined in Hydra.Query

Ord Variable Source # 
Instance details

Defined in Hydra.Query