rdf4h-3.0.4: A library for RDF processing in Haskell

Safe HaskellNone
LanguageHaskell98

Data.RDF.Namespace

Contents

Description

Defines types and utility functions related to namespaces, and some predefined values for commonly used namespaces, such as rdf, xsd, dublin core, etc.

Synopsis

Namespace types and functions

data Namespace Source #

Represents a namespace as either a prefix and uri, respectively, or just a uri.

mkPlainNS :: Text -> Namespace Source #

Make a namespace for the given URI reference.

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 PrefixMappings Source #

An alias for a map from prefix to namespace URI.

Constructors

PrefixMappings (Map Text Text) 

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 -> PrefixMappings Source #

Perform a left-biased merge of the two sets of prefix mappings.

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.

uriOf :: Namespace -> Text Source #

Determine the URI of the given namespace.

Predefined namespace values

rdf :: Namespace Source #

The RDF namespace.

rdfs :: Namespace Source #

The RDF Schema namespace.

dc :: Namespace Source #

The Dublin Core namespace.

dct :: Namespace Source #

The Dublin Core terms namespace.

owl :: Namespace Source #

The OWL namespace.

xsd :: Namespace Source #

The XML Schema namespace.

skos :: Namespace Source #

The SKOS namespace.

foaf :: Namespace Source #

The friend of a friend namespace.

ex :: Namespace Source #

Example namespace #1.

ex2 :: Namespace Source #

Example namespace #2.

standard_ns_mappings :: PrefixMappings Source #

The set of common predefined namespaces as a PrefixMappings value.

ns_mappings :: [Namespace] -> PrefixMappings Source #

Takes a list of Namespaces and returns PrefixMappings.