A cheatsheet for OData Core, Capability, and Measures Vocabularies
I take no responsibility for the correctness or currency of this data. The authoritative source can be found here.
The contents of this document are adapted from works bearing the following copyright
OData Version 4.0
OASIS Standard
24 February 2014
Copyright (c) OASIS Open 2014. All Rights Reserved.
Source: http://docs.oasis-open.org/odata/odata/v4.0/os/vocabularies/
Core terms needed to write vocabularies.
Description
- A brief description of a model elementLongDescription
- A lengthy description of a model element
IsLanguageDependent
- Properties and terms annotated with this term are language-dependent
RequiresType
- This is the type to use for all tagging terms
ResourcePath
- Resource path for entity container child, can be relative to xml:base and the request URLDereferenceableIDs
- Entity-ids are URLs that locate the identified entityConventionalIDs
- Entity-ids follow OData URL conventions
Permissions
- Permissions available for a property. The value of 2 is reserved for future use.
Permission | Value |
---|---|
None | 0 |
Read | 1 |
ReadWrite | 3 |
Immutable
- A value for this non-key property can be provided on insert and remains unchanged on updateComputed
- A value for this property is generated on both insert and updateIsURL
- Properties and terms annotated with this term MUST contain a valid URLAcceptableMediaTypes
- Lists the MIME types acceptable for the annotated entity type marked withHasStream="true"
or the annotated stream propertyMediaType
IsMediaType
- Properties and terms annotated with this term MUST contain a valid MIME typeOptimisticConcurrency
- Data modification requires the use of Etags. A non-empty collection contains the set of properties that are used to compute the ETag
The Capabilities vocabulary aims to provide a way for service authors to describe certain capabilities of an OData Service.
There are some capabilities which are strongly recommended for services to support even though they are optional. Support for $top
and $skip
is a good example as supporting these query options helps with performance of a service and are essential. Such capabilities are assumed to be default capabilities of an OData service even in the case that a capabilities annotation doesn’t exist. Capabilities annotations are mainly expected to be used to explicitly specify that a service doesn’t support such capabilities. Capabilities annotations can as well be used to declaratively specify the support of such capabilities. On the other hand, there are some capabilities that a service may choose to support or not support and in varying degrees. $filter
and $orderby
are such good examples. This vocabulary aims to define terms to specify support or no support for such capabilities.
A service is assumed to support by default the following capabilities even though an annotation doesn’t exist:
- Countability (
$count
,$inlinecount
) - Client pageability (
$top
,$skip
) - Expandability (
$expand
) - Indexability by key
- Batch support (
$batch
) - Navigability of navigation properties
A service is expected to support the following capabilities. If not supported, the service is expected to call out the restrictions using annotations:
- Filterability (
$filter
) - Sortability (
$orderby
) - Queryability of top level entity sets
- Query functions A client cannot assume that a service supports certain capabilities.
A client can try, but it needs to be prepared to handle an error in case the following capabilities are not supported:
- Insertability
- Updatability
- Deletability
ConformanceLevel
ConformanceLevelType |
---|
Minimal |
Intermediate |
Advanced |
SupportedFormats
- Media types of supported formats, including format parametersAcceptableEncodings
- List of acceptable compression methods for ($batch
) requests, e.g.gzip
AsynchronousRequestsSupported
- Service supports the asynchronous request preferenceBatchContinueOnErrorSupported
- Service supports the continue on error preferenceIsolationSupported
- Supported odata.isolation levels
IsolationLevel | Value |
---|---|
Snapshot | 1 |
CallbackSupported
- Supports callbacks for the specified protocolsCrossJoinSupported
- Supports cross joins for the entity sets in this containerChangeTracking
- Change tracking capabilities of this service or entity set
CountRestrictions
- Restrictions on/$count
path suffix and$count=true
system query optionNavigationRestrictions
- Restrictions on navigating properties according to OData URL conventionsIndexableByKey
- Supports key values according to OData URL conventionsTopSupported
- Supports$top
SkipSupported
- Supports$skip
BatchSupported
- Supports$batch
requestsFilterFunctions
- List of functions supported in$filter
FilterRestrictions
- Restrictions on$filter
expressionsSortRestrictions
- Restrictions on$orderby
expressionsExpandRestrictions
- Restrictions on$expand
expressionsSearchRestrictions
- Restrictions on$search
expressions
InsertRestrictions
- Restrictions on insert operationsUpdateRestrictions
- Restrictions on update operationsDeleteRestrictions
- Restrictions on delete operations
Terms describing monetary amounts and measured quantities.
ISOCurrency
- The currency for this monetary amount as an ISO 4217 currency codeScale
- The number of significant decimal places in the scale part (less than or equal to the number declared in the Scale facet)Unit
- The unit of measure for this measured quantity, e.g. cm for centimeters or % for percentages