rdf4h-1.2.1: A library for RDF processing in Haskell

Safe HaskellNone

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.

Constructors

PrefixedNS Text Text 
PlainNS Text 

mkPlainNS :: Text -> NamespaceSource

Make a namespace for the given URI reference.

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.

Constructors

PrefixMapping (Text, Text) 

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 -> 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.

uriOf :: Namespace -> TextSource

Determine the URI of the given namespace.

Predefined namespace values

rdf :: NamespaceSource

The RDF namespace.

rdfs :: NamespaceSource

The RDF Schema namespace.

dc :: NamespaceSource

The Dublic Core namespace.

dct :: NamespaceSource

The Dublin Core terms namespace.

owl :: NamespaceSource

The OWL namespace.

xsd :: NamespaceSource

The XML Schema namespace.

skos :: NamespaceSource

The SKOS namespace.

foaf :: NamespaceSource

The friend of a friend namespace.

ex :: NamespaceSource

Example namespace #1.

ex2 :: NamespaceSource

Example namespace #2.

standard_ns_mappings :: PrefixMappingsSource

The set of common predefined namespaces as a PrefixMappings value.

ns_mappings :: [Namespace] -> PrefixMappingsSource

Takes a list of Namespaces and returns PrefixMappings.