swish-0.8.0.0: A semantic web toolkit.

PortabilityOverloadedStrings
Stabilityexperimental
MaintainerDouglas Burke
Safe HaskellSafe-Infered

Swish.RDF.Parser.Utils

Description

Support for the RDF Parsing modules.

Synopsis

Documentation

type SpecialMap = Map String ScopedNameSource

Type for special name lookup table

prefixTable :: [Namespace]Source

Define default table of namespaces

specialTableSource

Arguments

:: Maybe ScopedName

initial base URI, otherwise uses defaultBase

-> [(String, ScopedName)] 

Define default special-URI table.

runParserWithErrorSource

Arguments

:: Parser a b

parser (carrying state) to apply

-> a

starting state for the parser

-> Text

input to be parsed

-> Either String b 

Run the parser and return the successful parse or an error message which consists of the standard Polyparse error plus a fragment of the unparsed input to provide context.

type ParseResult = Either String RDFGraphSource

The result of a parse, which is either an error message or a graph.

ignore :: Applicative f => f a -> f ()Source

Run the parser and ignore the result.

char :: Char -> Parser s CharSource

Match the character.

ichar :: Char -> Parser s ()Source

Match the character, ignoring the result.

string :: String -> Parser s StringSource

Match the text.

stringT :: Text -> Parser s TextSource

Match the text.

symbol :: String -> Parser s StringSource

Match the given string and any trailing whiteSpace.

isymbol :: String -> Parser s ()Source

As symbol but ignoring the result.

lexeme :: Parser s a -> Parser s aSource

Convert a parser into one that also matches, and ignores, trailing whiteSpace.

notFollowedBy :: (Char -> Bool) -> Parser s ()Source

Succeed if the next character does not match the given function.

whiteSpace :: Parser s ()Source

Match white space: a space or a comment (# character and anything following it up to to a new line).

skipMany :: Parser s a -> Parser s ()Source

Run the parser many times and ignore the result.

skipMany1 :: Parser s a -> Parser s ()Source

Run the parser many1 times and ignore the result.

endBySource

Arguments

:: Parser s a

parser

-> Parser s b

separator

-> Parser s [a] 

Match zero or more occurences of parser followed by separator.

sepEndBySource

Arguments

:: Parser s a

parser

-> Parser s b

separator

-> Parser s [a] 

Match zero or more occurences of the parser followed by the separator.

sepEndBy1Source

Arguments

:: Parser s a

parser

-> Parser s b

separator

-> Parser s [a] 

Accept one or more occurences of the parser separated by the separator. Unlike endBy the last separator is optional.

manyTillSource

Arguments

:: Parser s a

parser

-> Parser s b

delimiter

-> Parser s [a] 

Accept zero or more runs of the parser ending with the delimiter.

noneOf :: String -> Parser s CharSource

Accept any character that is not a member of the given string.

eoln :: Parser s ()Source

Match the end-of-line sequence (\n, \r, or \r\n).

fullStop :: Parser s ()Source

Matches ..

hex4 :: Parser a CharSource

A four-digit hex value (e.g. 1a34 or 03F1).

hex8 :: Parser a CharSource

An eight-digit hex value that has a maximum of 0010FFFF.

appendURIsSource

Arguments

:: URI

The base URI

-> URI

The URI to append (it can be an absolute URI).

-> Either String URI 

Append the two URIs. Should probably be moved out of RDFParser. It is also just a thin wrapper around relativeTo.