Search notes:

OData

OData is a protocol, based on REST, for creating and consuming data. OData Services are requested with HTTP GET requests.
https://services.odata.org/V4/TripPinServiceRW is an OData V4 sample Service.

Requesting Data

Return a list (JSON) of all entity sets:
get [Organization URI]/api/data/vx.y
{
  "@odata.context":"…data/v8.0/$metadata","value":[
    {
      "name":"accountleadscollection","kind":"EntitySet","url":"accountleadscollection"
    },{
      "name":"accounts","kind":"EntitySet","url":"accounts"
    },
    …
}
get [Organization URI]/api/data/vx.y/EntityDefinitions
get [Organization URI]/api/data/vx.y/EntityDefinitions?$filter=LogicalName eq 'account'
get [Organization URI]/api/data/vx.y/EntityDefinitions?$filter=LogicalName eq 'account'&$select=LogicalCollectionName
A collection of entities:
GET https://Service/path/to/root/ENTITY
An entity that is identified by its id:
GET https://Service/path/to/root/ENTITY('entity-id')
Get a specific property
GET https://Service/path/to/root/ENTITY('entity-id')/PROPERTY
The former request returns a JSON object. In order to get the raw value, $value can be appended
GET https://Service/path/to/root/ENTITY('entity-id')/PROPERTY/$value
Since properties are hierarchical, it's possible to access specific parts of an entity using a path through the properties:
GET https://Service/path/to/root/ENTITY('entity-id')/TOP-PROPERTY/SUB-PROPERTY/SUB-SUB-PROPERTY
Selecting by a criteria (filtering the result set) with the $filter keyword:
GET https://Service/path/to/root/ENTITY?$filter=PROPERTY eq 'Value'

$metadata

Gettting metadata (Common Schema Definition Language, CSDL) with $metadata. This does not return a JSON object but rather an XML document.
GET https://Service/path/to/root/$metadata

EntityDefinitions

Return entity definitions as JSON …
GET <SERVICE-ROOT>/EntityDefinitions
… and as XML:
GET <SERVICE-ROOT>/$metadata#EntityDefinitions

TODO

EDM - Entity Data Model

An Entity Data Model describes the structure of data in a way that is independent of its stored form.
Central concepts:
  • Entity types: named structure types with a key. May derive from other entity types. Entity types are templates for an Entity.
  • Comples types: named structures types without a key.
  • Entities: instances of entity types (such as Customer, Employee etc.) (Think rows in a database)
  • Relationships: have cardinality, are represented as navigation properties
  • Entity sets: named collection of entities (think table in a database?)
  • Actions
  • Functions

Association type (aka association)

An association type describes relationships.
An association has two association ends which both are entity types.
The association end multiplicity specifies the number of entities on the other end of the relation:
  • 1
  • 0 or 1
  • n (many)
Entities on one end of an association can be accessed through navigation properties.
Apparently, sometimes, there are also foreign keys on an entity type for such a lookup.

Entity container

An entity container groups entity sets and association sets.

Entity Set

An entity set is a collection of entities of a specific entity type.

Entity Type

Entity types are built from properties.
An entity type corresponds to a class, an entity to an instance of that class, thus it can be thought of as a template for the entities.
Entity types can be inherited from other entity types.
Entity types can be related to other entity types with associations.

Entity

An entity corresponds to an instance of an entity type (for example a specific customer).
An entity has a unique entity key within its entity set.

Navigation property

A navigation property allows to access entities on an association's end.

Property

A property stores part of the data in an entity.
There are primitive data types for properties (strings, integers etc.) and complex types.

Conceptual schema definition language (CSDL)

CSDL is a XML-based language which is used to define (or describe?) conceptual models which are based on the Entity Data Model.
The root of a CSDL is the <Schema> object.

OData query results

Lookup values

All lookups are named as _LOGICALNAME_value.

See also

ORDS: Oracle REST Data Services
GData: Google Data Protocol
OData Web API

Links

OData ABNF
The OData Test Service where this $metadata is found.
OData libraries

Index