packages feed

hydra-rdf-0.17.3: src/main/haskell/Hydra/Xml/Schema.hs

-- Note: this is an automatically generated file. Do not edit.

-- | A partial XML Schema model, focusing on datatypes. All simple datatypes (i.e. xsd:anySimpleType and below) are included.
-- | See: https://www.w3.org/TR/xmlschema-2
-- | Note: for most of the XML Schema datatype definitions included here, the associated Hydra type is simply
-- |       the string type. Exceptions are made for xsd:boolean and most of the numeric types, where there is a clearly
-- |       corresponding Hydra literal type.

module Hydra.Xml.Schema where

import qualified Hydra.Core as Core
import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum)
import qualified Data.Scientific as Sci
import qualified Data.Int as I

-- | The XSD anySimpleType, the base type of all simple (non-list, non-union-composed) XML Schema datatypes
newtype AnySimpleType =
  AnySimpleType {
    unAnySimpleType :: String}
  deriving (Eq, Ord, Read, Show)

_AnySimpleType = Core.Name "hydra.xml.schema.AnySimpleType"

-- | The XSD anyType, the root of the XML Schema type hierarchy
newtype AnyType =
  AnyType {
    unAnyType :: String}
  deriving (Eq, Ord, Read, Show)

_AnyType = Core.Name "hydra.xml.schema.AnyType"

-- | The XSD anyURI datatype: a URI reference
newtype AnyURI =
  AnyURI {
    unAnyURI :: String}
  deriving (Eq, Ord, Read, Show)

_AnyURI = Core.Name "hydra.xml.schema.AnyURI"

-- | The XSD base64Binary datatype: arbitrary binary data encoded as base64
newtype Base64Binary =
  Base64Binary {
    unBase64Binary :: String}
  deriving (Eq, Ord, Read, Show)

_Base64Binary = Core.Name "hydra.xml.schema.Base64Binary"

-- | The XSD boolean datatype: true or false
newtype Boolean =
  Boolean {
    unBoolean :: Bool}
  deriving (Eq, Ord, Read, Show)

_Boolean = Core.Name "hydra.xml.schema.Boolean"

-- | The XSD byte datatype: an 8-bit signed integer
newtype Byte =
  Byte {
    unByte :: I.Int8}
  deriving (Eq, Ord, Read, Show)

_Byte = Core.Name "hydra.xml.schema.Byte"

-- | An XML Schema constraining facet, restricting the value space of a datatype
newtype ConstrainingFacet =
  ConstrainingFacet {
    unConstrainingFacet :: ()}
  deriving (Eq, Ord, Read, Show)

_ConstrainingFacet = Core.Name "hydra.xml.schema.ConstrainingFacet"

-- | The name of a built-in XML Schema datatype
data Datatype =
  DatatypeAnySimpleType |
  DatatypeAnyType |
  DatatypeAnyURI |
  DatatypeBase64Binary |
  DatatypeBoolean |
  DatatypeByte |
  DatatypeDate |
  DatatypeDateTime |
  DatatypeDecimal |
  DatatypeDouble |
  DatatypeDuration |
  DatatypeENTITIES |
  DatatypeENTITY |
  DatatypeFloat |
  DatatypeGDay |
  DatatypeGMonth |
  DatatypeGMonthDay |
  DatatypeGYear |
  DatatypeGYearMonth |
  DatatypeHexBinary |
  DatatypeID |
  DatatypeIDREF |
  DatatypeIDREFS |
  DatatypeInt |
  DatatypeInteger |
  DatatypeLanguage |
  DatatypeLong |
  DatatypeNMTOKEN |
  DatatypeNOTATION |
  DatatypeName |
  DatatypeNegativeInteger |
  DatatypeNonNegativeInteger |
  DatatypeNonPositiveInteger |
  DatatypeNormalizedString |
  DatatypePositiveInteger |
  DatatypeQName |
  DatatypeShort |
  DatatypeString |
  DatatypeTime |
  DatatypeToken |
  DatatypeUnsignedByte |
  DatatypeUnsignedInt |
  DatatypeUnsignedLong |
  DatatypeUnsignedShort
  deriving (Eq, Ord, Read, Show)

_Datatype = Core.Name "hydra.xml.schema.Datatype"

_Datatype_anySimpleType = Core.Name "anySimpleType"

_Datatype_anyType = Core.Name "anyType"

_Datatype_anyURI = Core.Name "anyURI"

_Datatype_base64Binary = Core.Name "base64Binary"

_Datatype_boolean = Core.Name "boolean"

_Datatype_byte = Core.Name "byte"

_Datatype_date = Core.Name "date"

_Datatype_dateTime = Core.Name "dateTime"

_Datatype_decimal = Core.Name "decimal"

_Datatype_double = Core.Name "double"

_Datatype_duration = Core.Name "duration"

_Datatype_ENTITIES = Core.Name "ENTITIES"

_Datatype_ENTITY = Core.Name "ENTITY"

_Datatype_float = Core.Name "float"

_Datatype_gDay = Core.Name "gDay"

_Datatype_gMonth = Core.Name "gMonth"

_Datatype_gMonthDay = Core.Name "gMonthDay"

_Datatype_gYear = Core.Name "gYear"

_Datatype_gYearMonth = Core.Name "gYearMonth"

_Datatype_hexBinary = Core.Name "hexBinary"

_Datatype_ID = Core.Name "ID"

_Datatype_IDREF = Core.Name "IDREF"

_Datatype_IDREFS = Core.Name "IDREFS"

_Datatype_int = Core.Name "int"

_Datatype_integer = Core.Name "integer"

_Datatype_language = Core.Name "language"

_Datatype_long = Core.Name "long"

_Datatype_NMTOKEN = Core.Name "NMTOKEN"

_Datatype_NOTATION = Core.Name "NOTATION"

_Datatype_name = Core.Name "name"

_Datatype_negativeInteger = Core.Name "negativeInteger"

_Datatype_nonNegativeInteger = Core.Name "nonNegativeInteger"

_Datatype_nonPositiveInteger = Core.Name "nonPositiveInteger"

_Datatype_normalizedString = Core.Name "normalizedString"

_Datatype_positiveInteger = Core.Name "positiveInteger"

_Datatype_qName = Core.Name "qName"

_Datatype_short = Core.Name "short"

_Datatype_string = Core.Name "string"

_Datatype_time = Core.Name "time"

_Datatype_token = Core.Name "token"

_Datatype_unsignedByte = Core.Name "unsignedByte"

_Datatype_unsignedInt = Core.Name "unsignedInt"

_Datatype_unsignedLong = Core.Name "unsignedLong"

_Datatype_unsignedShort = Core.Name "unsignedShort"

-- | The XSD date datatype: a calendar date, optionally with a timezone
newtype Date =
  Date {
    unDate :: String}
  deriving (Eq, Ord, Read, Show)

_Date = Core.Name "hydra.xml.schema.Date"

-- | The XSD dateTime datatype: a date and time, optionally with a timezone
newtype DateTime =
  DateTime {
    unDateTime :: String}
  deriving (Eq, Ord, Read, Show)

_DateTime = Core.Name "hydra.xml.schema.DateTime"

-- | The XSD decimal datatype: an arbitrary-precision signed decimal number
newtype Decimal =
  Decimal {
    unDecimal :: String}
  deriving (Eq, Ord, Read, Show)

_Decimal = Core.Name "hydra.xml.schema.Decimal"

-- | The XSD double datatype: an IEEE 754 double-precision floating-point number
newtype Double_ =
  Double_ {
    unDouble :: Double}
  deriving (Eq, Ord, Read, Show)

_Double = Core.Name "hydra.xml.schema.Double"

-- | The XSD duration datatype: a duration of time
newtype Duration =
  Duration {
    unDuration :: String}
  deriving (Eq, Ord, Read, Show)

_Duration = Core.Name "hydra.xml.schema.Duration"

-- | The XSD ENTITIES datatype: a whitespace-separated list of unparsed entity names
newtype ENTITIES =
  ENTITIES {
    unENTITIES :: String}
  deriving (Eq, Ord, Read, Show)

_ENTITIES = Core.Name "hydra.xml.schema.ENTITIES"

-- | The XSD ENTITY datatype: the name of an unparsed entity
newtype ENTITY =
  ENTITY {
    unENTITY :: String}
  deriving (Eq, Ord, Read, Show)

_ENTITY = Core.Name "hydra.xml.schema.ENTITY"

-- | The XSD float datatype: an IEEE 754 single-precision floating-point number
newtype Float_ =
  Float_ {
    unFloat :: Float}
  deriving (Eq, Ord, Read, Show)

_Float = Core.Name "hydra.xml.schema.Float"

-- | The XSD gDay datatype: a day of the month, recurring
newtype GDay =
  GDay {
    unGDay :: String}
  deriving (Eq, Ord, Read, Show)

_GDay = Core.Name "hydra.xml.schema.GDay"

-- | The XSD gMonth datatype: a month of the year, recurring
newtype GMonth =
  GMonth {
    unGMonth :: String}
  deriving (Eq, Ord, Read, Show)

_GMonth = Core.Name "hydra.xml.schema.GMonth"

-- | The XSD gMonthDay datatype: a day of a specific month, recurring yearly
newtype GMonthDay =
  GMonthDay {
    unGMonthDay :: String}
  deriving (Eq, Ord, Read, Show)

_GMonthDay = Core.Name "hydra.xml.schema.GMonthDay"

-- | The XSD gYear datatype: a calendar year
newtype GYear =
  GYear {
    unGYear :: String}
  deriving (Eq, Ord, Read, Show)

_GYear = Core.Name "hydra.xml.schema.GYear"

-- | The XSD gYearMonth datatype: a specific month of a specific year
newtype GYearMonth =
  GYearMonth {
    unGYearMonth :: String}
  deriving (Eq, Ord, Read, Show)

_GYearMonth = Core.Name "hydra.xml.schema.GYearMonth"

-- | The XSD hexBinary datatype: arbitrary binary data encoded as hexadecimal
newtype HexBinary =
  HexBinary {
    unHexBinary :: String}
  deriving (Eq, Ord, Read, Show)

_HexBinary = Core.Name "hydra.xml.schema.HexBinary"

-- | The XSD ID datatype: an XML identifier attribute value, unique within a document
newtype ID =
  ID {
    unID :: String}
  deriving (Eq, Ord, Read, Show)

_ID = Core.Name "hydra.xml.schema.ID"

-- | The XSD IDREF datatype: a reference to an XML ID attribute value
newtype IDREF =
  IDREF {
    unIDREF :: String}
  deriving (Eq, Ord, Read, Show)

_IDREF = Core.Name "hydra.xml.schema.IDREF"

-- | The XSD IDREFS datatype: a whitespace-separated list of IDREF values
newtype IDREFS =
  IDREFS {
    unIDREFS :: String}
  deriving (Eq, Ord, Read, Show)

_IDREFS = Core.Name "hydra.xml.schema.IDREFS"

-- | The XSD int datatype: a 32-bit signed integer
newtype Int_ =
  Int_ {
    unInt :: Int}
  deriving (Eq, Ord, Read, Show)

_Int = Core.Name "hydra.xml.schema.Int"

-- | The XSD integer datatype: an arbitrary-precision signed integer
newtype Integer_ =
  Integer_ {
    unInteger :: Integer}
  deriving (Eq, Ord, Read, Show)

_Integer = Core.Name "hydra.xml.schema.Integer"

-- | The XSD language datatype: an RFC 3066 language tag
newtype Language =
  Language {
    unLanguage :: String}
  deriving (Eq, Ord, Read, Show)

_Language = Core.Name "hydra.xml.schema.Language"

-- | The XSD long datatype: a 64-bit signed integer
newtype Long =
  Long {
    unLong :: I.Int64}
  deriving (Eq, Ord, Read, Show)

_Long = Core.Name "hydra.xml.schema.Long"

-- | The XSD NMTOKEN datatype: an XML name token
newtype NMTOKEN =
  NMTOKEN {
    unNMTOKEN :: String}
  deriving (Eq, Ord, Read, Show)

_NMTOKEN = Core.Name "hydra.xml.schema.NMTOKEN"

-- | The XSD NOTATION datatype: the name of a notation declared in the document's DTD
newtype NOTATION =
  NOTATION {
    unNOTATION :: String}
  deriving (Eq, Ord, Read, Show)

_NOTATION = Core.Name "hydra.xml.schema.NOTATION"

-- | The XSD Name datatype: an XML Name (a token that may not start with a digit)
newtype Name =
  Name {
    unName :: String}
  deriving (Eq, Ord, Read, Show)

_Name = Core.Name "hydra.xml.schema.Name"

-- | The XSD negativeInteger datatype: an arbitrary-precision integer less than zero
newtype NegativeInteger =
  NegativeInteger {
    unNegativeInteger :: Integer}
  deriving (Eq, Ord, Read, Show)

_NegativeInteger = Core.Name "hydra.xml.schema.NegativeInteger"

-- | The XSD nonNegativeInteger datatype: an arbitrary-precision integer greater than or equal to zero
newtype NonNegativeInteger =
  NonNegativeInteger {
    unNonNegativeInteger :: Integer}
  deriving (Eq, Ord, Read, Show)

_NonNegativeInteger = Core.Name "hydra.xml.schema.NonNegativeInteger"

-- | The XSD nonPositiveInteger datatype: an arbitrary-precision integer less than or equal to zero
newtype NonPositiveInteger =
  NonPositiveInteger {
    unNonPositiveInteger :: Integer}
  deriving (Eq, Ord, Read, Show)

_NonPositiveInteger = Core.Name "hydra.xml.schema.NonPositiveInteger"

-- | The XSD normalizedString datatype: a string with no carriage return, line feed, or tab characters
newtype NormalizedString =
  NormalizedString {
    unNormalizedString :: String}
  deriving (Eq, Ord, Read, Show)

_NormalizedString = Core.Name "hydra.xml.schema.NormalizedString"

-- | The XSD positiveInteger datatype: an arbitrary-precision integer greater than zero
newtype PositiveInteger =
  PositiveInteger {
    unPositiveInteger :: Integer}
  deriving (Eq, Ord, Read, Show)

_PositiveInteger = Core.Name "hydra.xml.schema.PositiveInteger"

-- | The XSD QName datatype: a namespace-qualified XML name
newtype QName =
  QName {
    unQName :: String}
  deriving (Eq, Ord, Read, Show)

_QName = Core.Name "hydra.xml.schema.QName"

-- | The XSD short datatype: a 16-bit signed integer
newtype Short =
  Short {
    unShort :: I.Int16}
  deriving (Eq, Ord, Read, Show)

_Short = Core.Name "hydra.xml.schema.Short"

-- | The XSD string datatype: a character string
newtype String_ =
  String_ {
    unString :: String}
  deriving (Eq, Ord, Read, Show)

_String = Core.Name "hydra.xml.schema.String"

-- | The XSD time datatype: a time of day, optionally with a timezone
newtype Time =
  Time {
    unTime :: String}
  deriving (Eq, Ord, Read, Show)

_Time = Core.Name "hydra.xml.schema.Time"

-- | The XSD token datatype: a normalized string with no leading, trailing, or consecutive internal whitespace
newtype Token =
  Token {
    unToken :: String}
  deriving (Eq, Ord, Read, Show)

_Token = Core.Name "hydra.xml.schema.Token"

-- | The XSD unsignedByte datatype: an 8-bit unsigned integer
newtype UnsignedByte =
  UnsignedByte {
    unUnsignedByte :: I.Int16}
  deriving (Eq, Ord, Read, Show)

_UnsignedByte = Core.Name "hydra.xml.schema.UnsignedByte"

-- | The XSD unsignedInt datatype: a 32-bit unsigned integer
newtype UnsignedInt =
  UnsignedInt {
    unUnsignedInt :: I.Int64}
  deriving (Eq, Ord, Read, Show)

_UnsignedInt = Core.Name "hydra.xml.schema.UnsignedInt"

-- | The XSD unsignedLong datatype: a 64-bit unsigned integer
newtype UnsignedLong =
  UnsignedLong {
    unUnsignedLong :: Integer}
  deriving (Eq, Ord, Read, Show)

_UnsignedLong = Core.Name "hydra.xml.schema.UnsignedLong"

-- | The XSD unsignedShort datatype: a 16-bit unsigned integer
newtype UnsignedShort =
  UnsignedShort {
    unUnsignedShort :: Int}
  deriving (Eq, Ord, Read, Show)

_UnsignedShort = Core.Name "hydra.xml.schema.UnsignedShort"