Safe Haskell | None |
---|
Defines types and utility functions related to namespaces, and some predefined values for commonly used namespaces, such as rdf, xsd, dublin core, etc.
- data Namespace
- = PrefixedNS Text Text
- | PlainNS Text
- mkPlainNS :: Text -> Namespace
- mkPrefixedNS :: Text -> Text -> Namespace
- mkPrefixedNS' :: String -> String -> Namespace
- newtype PrefixMapping = PrefixMapping (Text, Text)
- newtype PrefixMappings = PrefixMappings (Map Text Text)
- toPMList :: PrefixMappings -> [(Text, Text)]
- mergePrefixMappings :: PrefixMappings -> PrefixMappings -> PrefixMappings
- mkUri :: Namespace -> Text -> Text
- prefixOf :: Namespace -> Maybe Text
- uriOf :: Namespace -> Text
- rdf :: Namespace
- rdfs :: Namespace
- dc :: Namespace
- dct :: Namespace
- owl :: Namespace
- xsd :: Namespace
- skos :: Namespace
- foaf :: Namespace
- ex :: Namespace
- ex2 :: Namespace
- standard_ns_mappings :: PrefixMappings
- ns_mappings :: [Namespace] -> PrefixMappings
Namespace types and functions
Represents a namespace as either a prefix and uri, respectively, or just a uri.
mkPrefixedNS :: Text -> Text -> NamespaceSource
Make a namespace having the given prefix for the given URI reference, respectively.
mkPrefixedNS' :: String -> String -> NamespaceSource
Make a namespace having the given prefix for the given URI reference, respectively, using strings which will be converted to bytestrings automatically.
newtype PrefixMapping Source
A mapping of a prefix to the URI for that prefix.
newtype PrefixMappings Source
An alias for a map from prefix to namespace URI.
toPMList :: PrefixMappings -> [(Text, Text)]Source
View the prefix mappings as a list of key-value pairs. The PM in in the name is to reduce name clashes if used without qualifying.
mergePrefixMappings :: PrefixMappings -> PrefixMappings -> PrefixMappingsSource
Perform a left-biased merge of the two sets of prefix mappings.
mkUri :: Namespace -> Text -> TextSource
Make a URI consisting of the given namespace and the given localname.
prefixOf :: Namespace -> Maybe TextSource
Determine the prefix of the given namespace, if it has one.
Predefined namespace values
standard_ns_mappings :: PrefixMappingsSource
The set of common predefined namespaces as a PrefixMappings
value.
ns_mappings :: [Namespace] -> PrefixMappingsSource
Takes a list of Namespace
s and returns PrefixMappings
.