swish-0.10.1.0: A semantic web toolkit.

Copyright | (c) 2003 Graham Klyne 2009 Vasili I Galchin 2011 2012 Douglas Burke
License | GPL V2
Maintainer | Douglas Burke
Stability | experimental
Portability | H98
Safe Haskell | None
Language | Haskell2010

Swish.Ruleset

Description

This module defines a ruleset data type, used to collect information about a ruleset that may contribute torwards inferences in RDF; e.g. RDF and RDFS are rulesets.

A `Ruleset` consists of a namespace, a collection of axioms, and a collection of rules.

Synopsis

- data Ruleset ex = Ruleset {
  - rsNamespace :: Namespace
  - rsAxioms :: [Formula ex]
  - rsRules :: [Rule ex]
  }
- type RulesetMap ex = Map Namespace (Ruleset ex)
- makeRuleset :: Namespace -> [Formula ex] -> [Rule ex] -> Ruleset ex
- getRulesetNamespace :: Ruleset ex -> Namespace
- getRulesetAxioms :: Ruleset ex -> [Formula ex]
- getRulesetRules :: Ruleset ex -> [Rule ex]
- getRulesetAxiom :: ScopedName -> Ruleset ex -> Maybe (Formula ex)
- getRulesetRule :: ScopedName -> Ruleset ex -> Maybe (Rule ex)
- getContextAxiom :: ScopedName -> Formula ex -> [Ruleset ex] -> Formula ex
- getMaybeContextAxiom :: ScopedName -> [Ruleset ex] -> Maybe (Formula ex)
- getContextRule :: ScopedName -> Rule ex -> [Ruleset ex] -> Rule ex
- getMaybeContextRule :: ScopedName -> [Ruleset ex] -> Maybe (Rule ex)

# Documentation

data Ruleset ex Source #

A Rule set.

Constructors

Ruleset |

Fields

- rsNamespace :: Namespace

  Namespace.

- rsAxioms :: [Formula ex]

  Axioms.

- rsRules :: [Rule ex]

  Rules.

#### Instances

Instances details

Eq (Ruleset ex) Source # | Ruleset comparisons are based only on their namespace components.
Instance details Defined in Swish.Ruleset Methods (==) :: Ruleset ex -> Ruleset ex -> Bool Source # (/=) :: Ruleset ex -> Ruleset ex -> Bool Source #

type RulesetMap ex = Map Namespace (Ruleset ex) Source #

A set of Rulesets labelled by their Namespace.

makeRuleset :: Namespace -> [Formula ex] -> [Rule ex] -> Ruleset ex Source #

Create a ruleset.

getRulesetNamespace :: Ruleset ex -> Namespace Source #

Extract the namespace of a ruleset.

getRulesetAxioms :: Ruleset ex -> [Formula ex] Source #

Extract the axioms from a ruleset.

getRulesetRules :: Ruleset ex -> [Rule ex] Source #

Extract the rules from a ruleset.

getRulesetAxiom :: ScopedName -> Ruleset ex -> Maybe (Formula ex) Source #

Find a named axiom in a ruleset.

getRulesetRule :: ScopedName -> Ruleset ex -> Maybe (Rule ex) Source #

Find a named rule in a ruleset.

getContextAxiom Source #

Arguments

:: ScopedName | Name of axiom.
-> Formula ex | Default axiom (used if named component does not exist).
-> [Ruleset ex] | Rulesets to search.
-> Formula ex |

Find a named axiom in a proof context.

getMaybeContextAxiom Source #

Arguments

:: ScopedName | Name of axiom.
-> [Ruleset ex] | Rulesets to search.
-> Maybe (Formula ex) |

Find a named axiom in a proof context.

getContextRule Source #

Arguments

:: ScopedName | Name of rule.
-> Rule ex | Default rule (used if named component does not exist).
-> [Ruleset ex] | Rulesets to search.
-> Rule ex |

Find a named rule in a proof context.

getMaybeContextRule Source #

Arguments

:: ScopedName | Name of rule.
-> [Ruleset ex] | Rulesets to search.
-> Maybe (Rule ex) |

Find a named rule in a proof context.