rdf4h-3.1.0: 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.

Instances
Eq Namespace Source # 
Instance details

Defined in Data.RDF.Types

Show Namespace Source # 
Instance details

Defined in Data.RDF.Types

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) 
Instances
Eq PrefixMappings Source # 
Instance details

Defined in Data.RDF.Types

Ord PrefixMappings Source # 
Instance details

Defined in Data.RDF.Types

Show PrefixMappings Source # 
Instance details

Defined in Data.RDF.Types

Generic PrefixMappings Source # 
Instance details

Defined in Data.RDF.Types

Associated Types

type Rep PrefixMappings :: * -> * #

Binary PrefixMappings Source # 
Instance details

Defined in Data.RDF.Types

NFData PrefixMappings Source # 
Instance details

Defined in Data.RDF.Types

Methods

rnf :: PrefixMappings -> () #

type Rep PrefixMappings Source # 
Instance details

Defined in Data.RDF.Types

type Rep PrefixMappings = D1 (MetaData "PrefixMappings" "Data.RDF.Types" "rdf4h-3.1.0-595ICCEmMGNEkovJvesGxY" True) (C1 (MetaCons "PrefixMappings" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (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.