Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
2.2.2 Abstract Type System

2.2.2 Abstract Type System

The abstract type system that is used to define the primitive types that are supported by a data service is defined in [MC-CSDL] (section 2.2.1). When the value of a primitive type needs to be represented in a URI or HTTP header, the representation that is written should use the primitive type literal form representation that is defined in the following table. A primitive type representation in a request or a response payload is defined in format-specific sections of this document.

The following listing that follows the grammar rules in this section makes reference to the following shared ABNF [RFC5234] grammar rules.

 SQUOTE            =  %x27              ; ' (single quote)
 EQ                =  %x3D              ; = (equal sign)
 SEMI              =  %x3B              ; ; (semicolon)
 SP                =  %x20              ;   (single-width horizontal space character)
 COMMA             =  %x2C              ; , (comma)
 nonZeroDigit      =  %x31-39           ; all digits except zero
 doubleZeroToSixty =  "0" DIGIT
                      / "1" DIGIT
                      / "2" DIGIT
                      / "3" DIGIT
                      / "4" DIGIT
                      / "5" DIGIT
 nan               =  "NaN"
 negativeInfinity  =  "-INF"
 positiveInfinity  =  "INF"
 nanInfinity       =  nan / negativeInfinity / positiveInfinity
 sign              =  "-" / ""
 DIGIT             =  ; see [RFC5234] Appendix B.1 Core Rules
 UTF8-char         =  ; see [RFC3629]

The following table defines the literal form representations of Entity Data Model (EDM) primitive types.

EDM primitive type

ABNF rule for primitive type representation in URIs and HTTP headers

Primitive type literal form (ABNF definition)

null

nullLiteral

nullLiteral        =   "null"

Edm.Binary

binaryLiteral

binaryUriLiteral   =   caseSensitiveToken 
                       SQUOTE 
                       binaryLiteral 
                       SQUOTE
                 
binaryLiteral      =   hexDigPair
                 
caseSensitiveToken =   "X" / "binary"
; X is case   sensitive, and binary is not case sensitive
                 
hexDigPair         =   2*HEXDIG 
                       [hexDigPair]

Edm.Boolean

booleanLiteral

booleanLiteral =   true / false
                 
true           =   "true" / "1"
; clients/servers   SHOULD also recognize "True"
                 
false          =   "false" / "0"
; clients/servers   SHOULD also recognize "False"

Edm.Byte

byteLiteral

byteLiteral    =   1*3DIGIT; 
                 
; For further   information on the value range for
; the Edm.Byte type,   see [MC-CSDL]

Edm.DateTime

dateTimeUriLiteral

datetimeUriLiteral =   "datetime"
                       SQUOTE 
                       dateTimeLiteral
                       SQUOTE
                 
dateTimeLiteral =   year "-" 
                    month "-" 
                    day "T"
                    hour ":" 
                    minute 
                    [":" second ["." nanoSeconds]] 
                    [timeZone]
year = 4Digit;
                 
month = <any   number between 1 and 12 inclusive>
                 
day = nonZeroDigit 
      /   ("0" nonZeroDigit)
        /("1" DIGIT) 
      /   ("2" DIGIT ) 
      /   "3" ("0" / "1")
                 
hour = nonZeroDigit 
       /   ("0" nonZeroDigit)
       /   ("1"  DIGIT) 
       /   ("2" zeroToFour)
zeroToFour= <any   nuumber between 0 and 4 inclusive>
minute   =doubleZeroToSixty
second =   doubleZeroToSixty
nanoSeconds=   1*7Digit
timeZone = (
                ("+" / "-") 
               hour   ':' minute
           ) 
           / 'Z'

Edm.Decimal

decimalUriLiteral

decimalUriLiteral =   decimalLiteral
                      ("M"/"m")
                 
decimalLiteral    =   sign 1*29DIGIT 
                       ["." 1*29DIGIT]

Edm.Double

doubleLiteral

doubleLiteral = (
   (
   nonDecimalPoint /   
   nonExpDecimal  / 
   expDecimal
   ) 
   "D" /   "d"
)  /
( nanInfinity   ["D" / "d"])
                 
nonDecimalPoint=   sign 1*17DIGIT
                 
nonExpDecimal  =   sign* DIGIT "." *DIGIT
                 
expDecimal     =   sign 
                   1*DIGIT 
                   "."
                   16DIGIT 
                   ("e" / "E")
                   sign 
                   1*3DIGIT
                 
; for additional   information on the value range 
; of the Edm.Double   type, see [MC-CSDL]

Edm.Single

singleUriLiteral

singleUriLiteral = 
  ( singleLiteral   ("F" / "f"))/
  ( nanInfinity [   "F" / "f" ])
   
singleLiteral    = 
   nonDecimalPoint /   
   nonExpDecimal / 
   expDecimal  
                 
nonDecimalPoint = sign   1*8DIGIT
                 
nonExpDecimal   =   sign 
                    *DIGIT  
                    "." 
                    *DIGIT
expDecimal      =   sign 
                    1*DIGIT 
                    "." 
                    8DIGIT 
                    ("e" / "E") 
                    sign 
                    1*2DIGIT
                 
; for additional   information on the value range 
; of the Edm.Single   type, see [MC-CSDL]

Edm.Float

singleLiteral

See Edm.Single.

Edm.Guid

guidUriLiteral

guidUriLiteral=   "guid" 
                   SQUOTE 
                   guidLiteral
                   SQUOTE
                 
guidLiteral   =   8HEXDIG "-" 
                  4HEXDIG "-" 
                  4HEXDIG "-"
                  4HEXDIG "-" 
                  12HEXDIG

Edm.Int16

int16Literal

int16Literal= sign 1*5DIGIT

Edm.Int32

int32Literal

int32Literal= sign   1*10DIGIT

Edm.Int64

int64UriLiteral

int64UriLiteral=   int64Literal
                   ("L" / "l")
int64Literal   =   sign 1*19DIGIT

Edm.SByte

sbyteliteral

sbyteliteral= sign 1*3DIGIT

Edm.String

stringUriLiteral

stringUriLiteral =   SQUOTE 
                     [*characters] 
                     SQUOTE
                 
characters       =   UTF8-char

Edm.Time

timeUriLiteral

timeUriLiteral = 
   "time"
   SQUOTE 
   timeLiteral
   SQUOTE
                 
timeLiteral =   <Defined by the lexical representation
for dayTimeDuration   in [XMLSCHEMA1.1/2:2012]>

Edm.DateTimeOffset

dateTimeOffsetUriLiteral

dateTimeOffsetUriLiteral   = 
     "datetimeoffset"
   SQUOTE 
     dateTimeOffsetLiteral
   SQUOTE
                 
dateTimeOffsetLiteral   = <Defined by the lexical representation
for datetime   (including timezone offset) in [XMLSCHEMA2/2].
The timezone offset   is required.>

Edm.Geography

N/A

N/A

Edm.GeographyPoint

geographyFullPointLiteral

The two doubles in position literals are to be interpreted as longitude, then latitude.

geographyFullPointLiteral   = 
  geographyPrefix
  fullPointLiteral
  SQUOTE
                 
geographyPrefix =
    "geography"
  SQUOTE
                 
fullPointLiteral =
  sridLiteral
  pointLiteral
                 
pointLiteral =
  "Point"
  pointData
                 
pointData =
  "("
  positionLiteral
  ")"
                 
positionLiteral =
  doubleLiteral
  SP
  doubleLiteral
                 
sridLiteral =
  "SRID"
  EQ
  1*5DIGIT
  SEMI

Edm.GeographyLineString

geographyFullLineStringLiteral

The two doubles in position literals are to be interpreted as longitude, then latitude.

geographyFullLineStringLiteral   = 
  geographyPrefix
    fullLineStringLiteral
  SQUOTE
                 
fullLineStringLiteral   =
  sridLiteral
  lineStringLiteral
                 
lineStringLiteral =
    "LineString"
  lineStringData
                 
lineStringData =
  "("
  positionLiteral
  [COMMA   positionLiteral]+
  ")"

Edm.GeographyPolygon

geographyFullPolygonLiteral

The two doubles in position literals are to be interpreted as longitude, then latitude.

geographyFullPolygonLiteral   = 
  geographyPrefix
  fullPolygonLiteral
  SQUOTE
                 
fullPolygonLiteral =
  sridLiteral
  polygonLiteral
                 
polygonLiteral =
    "Polygon"
  polygonData
                 
polygonData =
  "("
  ringLiteral
  [COMMA   ringLiteral]*
  ")"
                 
ringLiteral =
  "("
  firstPosition
  [COMMA   positionLiteral]*
  COMMA
  firstPosition
  ")"
                 
firstPosition =
  positionLiteral
                 
Within each   ringLiteral, the two firstPosition elements MUST
be an exact   syntactic match to each other.
                 
Within the   polygonData, the ringLiterals MUST specify their
points in   appropriate winding order. In order of traversal,
points to the left   side of the ring are interpreted as being
in the polygon.

Edm.GeographyCollection

geographyFullGeoCollectionLiteral

The two doubles in position literals are to be interpreted as longitude, then latitude.

geographyFullGeoCollectionLiteral   = 
  geographyPrefix
    fullGeoCollectionLiteral
  SQUOTE
                 
fullGeoCollectionLiteral   =
  sridLiteral
    geoCollectionLiteral
                 
geoCollectionLiteral   =
    "GeometryCollection("
  geoLiteral
  [COMMA   geoLiteral]*
  ")"
                 
geoLiteral =
  pointLiteral
  |   lineStringLiteral
  | polygonLiteral
  |   geoCollectionLiteral
  |   multiPointLiteral
  |   multiLineStringLiteral
  |   multiPolygonLiteral

Edm.GeographyMultiPoint

geographyFullMultiPointLiteral

The two doubles in position literals are to be interpreted as longitude, then latitude.

geographyFullMultiPointLiteral   =
  sridLiteral
  multiPointLiteral
                 
multiPointLiteral =
  "MultiPoint("
  [pointData
    [COMMA   pointData]*
  ]?
  ")"

Edm.GeographyMultiLineString

geographyFullMultiLineStringLiteral

The two doubles in position literals are to be interpreted as longitude, then latitude.

geographyFullMultiLineStringLiteral   = 
  geographyPrefix
    fullMultiLineStringLiteral
  SQUOTE
                 
fullMultiLineStringLiteral   =
  sridLiteral
    multiLineStringLiteral
                 
multiLineStringLiteral   =
    "MultiLineString("
  [lineStringData
    [COMMA   lineStringData]*
  ]?
  ")"

Edm.GeographyMultiPolygon

geographyFullMultiPolygonLiteral

The two doubles in position literals are to be interpreted as longitude, then latitude.

geographyFullMultiPolygonLiteral   = 
  geographyPrefix
    fullMultiPolygonLiteral
  SQUOTE
                 
fullMultiPolygonLiteral   =
  sridLiteral
    multiPolygonLiteral
                 
multiPolygonLiteral   =
    "MultiPolygon("
  [polygonData
    [COMMA   polygonData]*
  ]?
  ")"

Edm.Geometry

N/A

N/A

Edm.GeometryPoint

geometryFullPointLiteral

The two doubles in position literals are to be interpreted as X, then Y.

geometryFullPointLiteral   = 
  geometryPrefix
  fullPointLiteral
  SQUOTE
                 
geometryPrefix =
    "geometry"
  SQUOTE

Edm.GeometryLineString

geometryFullLineStringLiteral

The two doubles in position literals are to be interpreted as X, then Y.

geometryFullLineStringLiteral   = 
  geometryPrefix
    fullLineStringLiteral
  SQUOTE

Edm.GeometryPolygon

geometryFullPolygonLiteral

The two doubles in position literals are to be interpreted as X, then Y.

geometryFullPolygonLiteral   = 
  geometryPrefix
  fullPolygonLiteral
  SQUOTE

Edm.GeometryCollection

geometryFullGeoCollectionLiteral

The two doubles in position literals are to be interpreted as X, then Y.

geometryFullGeoCollectionLiteral   = 
  geometryPrefix
    fullGeoCollectionLiteral
  SQUOTE

Edm.GeometryMultiPoint

geometryFullMultiPointLiteral

The two doubles in position literals are to be interpreted as X, then Y.

geometryFullMultiPointLiteral   = 
  geometryPrefix
  fullMultiPointLiteral
  SQUOTE

Edm.GeometryMultiLineString

geometryFullMultiLineStringLiteral

The two doubles in position literals are to be interpreted as X, then Y.

geometryFullMultiLineStringLiteral   = 
  geometryPrefix
    fullMultiLineStringLiteral
  SQUOTE

Edm.GeometryMultiPolygon

geometryFullMultiPolygonLiteral

The two doubles in position literals are to be interpreted as X, then Y.

geometryFullMultiPolygonLiteral   = 
  geometryPrefix
    fullMultiPolygonLiteral
  SQUOTE

Edm.Stream

N/A

N/A

Collection

N/A

N/A

Table: Literal Form of Entity Data Model Primitive Types

Show:
© 2015 Microsoft