Safe Haskell | Safe-Infered |
---|
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
- mkPlainNS :: ByteString -> Namespace
- mkPrefixedNS :: ByteString -> ByteString -> Namespace
- mkPrefixedNS' :: String -> String -> Namespace
- newtype PrefixMapping = PrefixMapping (ByteString, ByteString)
- newtype PrefixMappings = PrefixMappings (Map ByteString ByteString)
- toPMList :: PrefixMappings -> [(ByteString, ByteString)]
- mergePrefixMappings :: PrefixMappings -> PrefixMappings -> PrefixMappings
- mkUri :: Namespace -> ByteString -> ByteString
- prefixOf :: Namespace -> Maybe ByteString
- uriOf :: Namespace -> ByteString
- rdf :: Namespace
- rdfs :: Namespace
- dc :: Namespace
- dct :: Namespace
- owl :: Namespace
- xsd :: Namespace
- skos :: Namespace
- foaf :: Namespace
- ex :: Namespace
- ex2 :: Namespace
- standard_ns_mappings :: PrefixMappings
Namespace types and functions
Represents a namespace as either a prefix and uri, respectively, or just a uri.
mkPlainNS :: ByteString -> NamespaceSource
Make a namespace for the given URI reference.
mkPrefixedNS :: ByteString -> ByteString -> 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 -> [(ByteString, ByteString)]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 -> ByteString -> ByteStringSource
Make a URI consisting of the given namespace and the given localname.
prefixOf :: Namespace -> Maybe ByteStringSource
Determine the prefix of the given namespace, if it has one.
uriOf :: Namespace -> ByteStringSource
Determine the URI of the given namespace.
Predefined namespace values
standard_ns_mappings :: PrefixMappingsSource
The set of common predefined namespaces as a PrefixMappings
value.