swish-0.10.1.0: A semantic web toolkit.

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

Swish.RDF.ClassRestrictionRule

Description

This module implements an inference rule based on a restruction on class membership of one or more values.

Synopsis

- data ClassRestriction = ClassRestriction {
  - crName :: ScopedName
  - crFunc :: ClassRestrictionFn
  }
- type ClassRestrictionFn = [Maybe RDFLabel] -> Maybe [[RDFLabel]]
- makeDatatypeRestriction :: RDFDatatypeVal vt -> DatatypeRel vt -> ClassRestriction
- makeDatatypeRestrictionFn :: RDFDatatypeVal vt -> DatatypeRelFn vt -> ClassRestrictionFn
- makeRDFClassRestrictionRules :: [ClassRestriction] -> RDFGraph -> [RDFRule]
- makeRDFDatatypeRestrictionRules :: RDFDatatypeVal vt -> RDFGraph -> [RDFRule]
- falseGraph :: RDFGraph
- falseGraphStr :: Builder

# Documentation

data ClassRestriction Source #

Datatype for named class restriction

Constructors

ClassRestriction |

Fields

- crName :: ScopedName
- crFunc :: ClassRestrictionFn

#### Instances

Instances details

Eq ClassRestriction Source # | Equality of class restrictions is based on the name of the restriction.
Instance details Defined in Swish.RDF.ClassRestrictionRule Methods (==) :: ClassRestriction -> ClassRestriction -> Bool Source # (/=) :: ClassRestriction -> ClassRestriction -> Bool Source #
Show ClassRestriction Source # |
Instance details Defined in Swish.RDF.ClassRestrictionRule Methods showsPrec :: Int -> ClassRestriction -> ShowS Source # show :: ClassRestriction -> String Source # showList :: [ClassRestriction] -> ShowS Source #

type ClassRestrictionFn = [Maybe RDFLabel] -> Maybe [[RDFLabel]] Source #

Type of function that evaluates missing node values in a restriction from those supplied.

makeDatatypeRestriction :: RDFDatatypeVal vt -> DatatypeRel vt -> ClassRestriction Source #

Make a class restriction from a datatype relation.

This lifts application of the datatype relation to operate on `RDFLabel` values, which are presumed to contain appropriately datatyped values.

makeDatatypeRestrictionFn :: RDFDatatypeVal vt -> DatatypeRelFn vt -> ClassRestrictionFn Source #

Make a class restriction function from a datatype relation function.

makeRDFClassRestrictionRules :: [ClassRestriction] -> RDFGraph -> [RDFRule] Source #

Make a list of class restriction rules given a list of class restriction values and a graph containing one or more class restriction definitions.

makeRDFDatatypeRestrictionRules :: RDFDatatypeVal vt -> RDFGraph -> [RDFRule] Source #

Make restriction rules from the supplied datatype and graph.

falseGraph :: RDFGraph Source #

The graph

    _:a <http://id.ninebynine.org/2003/rdfext/rdfd#false> _:b .

Exported for testing.

falseGraphStr :: Builder Source #

Exported for testing.