| Portability | TypeSynonymInstances, MultiParamTypeClasses, FlexibleInstances, OverloadedStrings |
|---|---|
| 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
- makeNamespace :: Maybe Text -> URI -> Namespace
- makeNamespaceQName :: Namespace -> Text -> QName
- getNamespacePrefix :: Namespace -> Maybe Text
- getNamespaceURI :: Namespace -> URI
- getNamespaceTuple :: Namespace -> (Maybe Text, URI)
- data ScopedName
- getScopeNamespace :: ScopedName -> Namespace
- getScopeLocal :: ScopedName -> Text
- getScopePrefix :: ScopedName -> Maybe Text
- getScopeURI :: ScopedName -> URI
- getQName :: ScopedName -> QName
- getScopedNameURI :: ScopedName -> URI
- matchName :: String -> ScopedName -> Bool
- makeScopedName :: Maybe Text -> URI -> Text -> ScopedName
- makeQNameScopedName :: Maybe Text -> QName -> ScopedName
- makeURIScopedName :: URI -> ScopedName
- makeNSScopedName :: Namespace -> Text -> ScopedName
- nullScopedName :: ScopedName
- namespaceToBuilder :: Namespace -> Builder
Documentation
A NameSpace value consists of an optional prefix and a corresponding URI.
makeNamespaceQName :: Namespace -> Text -> 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.
Instances
| Eq ScopedName | |
| Ord ScopedName | |
| Show ScopedName | |
| IsString ScopedName | This is not total since it will fail if the input string is not a valid URI. |
| FromRDFLabel ScopedName | Converts from a Resource. |
| ToRDFLabel ScopedName | Converts to a Resource. |
| 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) |
getScopeURI :: ScopedName -> URISource
getQName :: ScopedName -> QNameSource
Get QName corresponding to a scoped name
getScopedNameURI :: ScopedName -> URISource
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 :: Maybe Text -> URI -> Text -> ScopedNameSource
Construct a ScopedName from prefix, URI and local name
makeQNameScopedName :: Maybe Text -> QName -> ScopedNameSource
Construct a ScopedName from a QName
makeURIScopedName :: URI -> ScopedNameSource
Construct a ScopedName for a bare URI (the label is set to "").
makeNSScopedName :: Namespace -> Text -> ScopedNameSource
Construct a ScopedName from a Namespace and local component
nullScopedName :: ScopedNameSource
This should never appear as a valid name
namespaceToBuilder :: Namespace -> BuilderSource
Utility routine to create a @prefix line (matching N3/Turtle) grammar for this namespace.