| Portability | TypeSynonymInstances, MultiParamTypeClasses |
|---|---|
| Stability | experimental |
| Maintainer | Douglas Burke |
Swish.Utils.Namespace
Description
This module defines algebraic datatypes for namespaces and scoped names.
For these purposes, a namespace is a prefix and URI used to identify a namespace (cf. XML namespaces), and a scoped name is a name that is scoped by a specified namespace.
- data Namespace = Namespace {}
- makeNamespaceQName :: Namespace -> String -> QName
- nullNamespace :: Namespace
- data ScopedName = ScopedName {}
- getScopePrefix :: ScopedName -> String
- getScopeURI :: ScopedName -> String
- getQName :: ScopedName -> QName
- getScopedNameURI :: ScopedName -> String
- matchName :: String -> ScopedName -> Bool
- makeScopedName :: String -> String -> String -> ScopedName
- makeQNameScopedName :: QName -> ScopedName
- makeUriScopedName :: String -> ScopedName
- nullScopedName :: ScopedName
Documentation
A NameSpace value consists of a prefix and a corresponding URI.
The prefix may be empty (""), in which case it is assumed to be unknown.
NOTE: not clear whether nsPrefix should be empty or set to "?".
makeNamespaceQName :: Namespace -> String -> QNameSource
data ScopedName Source
A full ScopedName value has a QName prefix, namespace URI
and a local part. ScopedName values may omit the prefix
(see Namespace) or the local part.
Some applications may handle null namespace URIs as meaning the local part is relative to some base URI.
Constructors
| ScopedName | |
Instances
| Eq ScopedName | |
| Ord ScopedName | |
| Show ScopedName | |
| IsString ScopedName | |
| FromRDFLabel ScopedName | |
| ToRDFLabel ScopedName | |
| LookupEntryClass ClassRestriction ScopedName ClassRestriction | |
| LookupEntryClass NamedGraph ScopedName [RDFGraph] | |
| LookupEntryClass (Rule ex) ScopedName (Rule ex) | |
| LookupEntryClass (Formula ex) ScopedName (Formula ex) | |
| LookupEntryClass (DatatypeRel vt) ScopedName (DatatypeRel vt) | |
| LookupEntryClass (OpenVarBindingModify a b) ScopedName (OpenVarBindingModify a b) | Allow an |
| LookupEntryClass (VarBindingModify a b) ScopedName (VarBindingModify a b) | Allow a VarBindingModify value to be accessed using a |
| LookupEntryClass (DatatypeMod vt lb vn) ScopedName (DatatypeMod vt lb vn) | |
| LookupEntryClass (Datatype ex lb vn) ScopedName (Datatype ex lb vn) |
getQName :: ScopedName -> QNameSource
Get QName corresponding to a scoped name
getScopedNameURI :: ScopedName -> StringSource
Get URI corresponding to a scoped name (using RDF conventions)
matchName :: String -> ScopedName -> BoolSource
Test if supplied string matches the display form of a scoped name.
makeScopedName :: String -> String -> String -> ScopedNameSource
Construct a ScopedName from prefix, URI and local name
makeQNameScopedName :: QName -> ScopedNameSource
Construct a ScopedName from a QName
makeUriScopedName :: String -> ScopedNameSource
Construct a ScopedName for a bare URI
nullScopedName :: ScopedNameSource
This should never appear as a valid name