Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Defines types and utility functions related to namespaces, and some predefined values for commonly used namespaces, such as rdf, xsd, dublin core, etc.
Synopsis
- data Namespace
- 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)]
- mkUri :: Namespace -> Text -> Text
- prefixOf :: Namespace -> Maybe Text
- uriOf :: Namespace -> Text
- rdf :: Namespace
- rdfs :: Namespace
- dc :: Namespace
- dct :: Namespace
- owl :: Namespace
- schema :: Namespace
- xml :: 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 -> Namespace Source #
Make a namespace having the given prefix for the given URI reference, respectively.
mkPrefixedNS' :: String -> String -> Namespace Source #
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.
Instances
Show PrefixMapping Source # | |
Defined in Data.RDF.Types showsPrec :: Int -> PrefixMapping -> ShowS # show :: PrefixMapping -> String # showList :: [PrefixMapping] -> ShowS # | |
Eq PrefixMapping Source # | |
Defined in Data.RDF.Types (==) :: PrefixMapping -> PrefixMapping -> Bool # (/=) :: PrefixMapping -> PrefixMapping -> Bool # | |
Ord PrefixMapping Source # | |
Defined in Data.RDF.Types compare :: PrefixMapping -> PrefixMapping -> Ordering # (<) :: PrefixMapping -> PrefixMapping -> Bool # (<=) :: PrefixMapping -> PrefixMapping -> Bool # (>) :: PrefixMapping -> PrefixMapping -> Bool # (>=) :: PrefixMapping -> PrefixMapping -> Bool # max :: PrefixMapping -> PrefixMapping -> PrefixMapping # min :: PrefixMapping -> PrefixMapping -> PrefixMapping # |
newtype PrefixMappings Source #
An alias for a map from prefix to namespace URI.
Instances
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.
mkUri :: Namespace -> Text -> Text Source #
Make a URI consisting of the given namespace and the given localname.
prefixOf :: Namespace -> Maybe Text Source #
Determine the prefix of the given namespace, if it has one.
Predefined namespace values
standard_ns_mappings :: PrefixMappings Source #
The set of common predefined namespaces as a PrefixMappings
value.
ns_mappings :: [Namespace] -> PrefixMappings Source #
Takes a list of Namespace
s and returns PrefixMappings
.