swish-0.3.2.1: A semantic web toolkit.

PortabilityH98
Stabilityexperimental
MaintainerDouglas Burke

Swish.RDF.RDFDatatype

Description

This module defines the structures used by Swish to represent and manipulate RDF datatypes.

Synopsis

Documentation

type RDFDatatype = Datatype RDFGraph RDFLabel RDFLabelSource

RDF datatype wrapper used with RDF graph values

type RDFDatatypeVal vt = DatatypeVal RDFGraph vt RDFLabel RDFLabelSource

RDF datatype value used with RDF graph values

type RDFDatatypeMod vt = DatatypeMod vt RDFLabel RDFLabelSource

RDF datatype modifier used with RDF graph values

type RDFModifierFn = ModifierFn RDFLabelSource

RDF value modifier function type

This indicates a modifier function that operates on RDFLabel values.

type RDFApplyModifier = ApplyModifier RDFLabel RDFLabelSource

RDF value modifier application function type

This indicates a function that applies RDFModifierFn functions.

makeRdfDtOpenVarBindingModifySource

Arguments

:: RDFDatatypeVal vt

is an RDFDatatype value containing details of the datatype for which a variable binding modifier is created.

-> RDFDatatypeMod vt

is the data value modifier value that defines the calculations that are used to implement a variable binding modifier.

-> RDFOpenVarBindingModify 

Create an RDFOpenVarBindingModify value.

The key purpose of this function is to lift the supplied variable constraint functions from operating on data values directly to a corresponding list of functions that operate on values contained in RDF graph labels (i.e. RDF literal nodes). It also applies node type checking, such that if the actual RDF nodes supplied do not contain appropriate values then the variable binding is not accepted.

makeRdfDtOpenVarBindingModifiersSource

Arguments

:: RDFDatatypeVal vt

is an RDFDatatype value containing details of the datatype for which variable binding modifiers are created.

-> [RDFOpenVarBindingModify] 

Create all RDFOpenVarBindingModify values for a given datatype value. See makeRdfDtOpenVarBindingModify.

applyRDFDatatypeMod :: RDFDatatypeVal vt -> RDFDatatypeMod vt -> [RDFLabel] -> [RDFVarBinding] -> [RDFVarBinding]Source

Apply a datatype modifier using supplied RDF labels to a supplied RDF variable binding.

type RDFDatatypeSub supvt subvt = DatatypeSub RDFGraph RDFLabel RDFLabel supvt subvtSource

Describe a subtype/supertype relationship between a pair of RDF datatypes.

fromRDFLabel :: RDFDatatypeVal vt -> RDFLabel -> Maybe vtSource

Convert from a typed literal to a Haskell value, with the possibility of failure.

toRDFLabel :: RDFDatatypeVal vt -> vt -> Maybe RDFLabelSource

Convert a Haskell value to a typed literal (label), with the possibility of failure.

makeDatatypedLiteral :: ScopedName -> String -> RDFLabelSource

Create a typed literal from the given value.