From 1afd59b58108b069a1c24e8ad283483aef5af945 Mon Sep 17 00:00:00 2001
From: Ralf Handl An entity or complex type instance can have one or more stream properties. The actual stream data is not usually contained in the representation. Instead stream property data is generally read and edited via URLs. Depending on the metadata level, the stream property MAY be annotated to provide the read link, edit link, media type, and ETag of the media stream through a set of If the actual stream data is included inline, the control information If the actual stream data is included inline, the control information If the included stream property has no value, the non-existing stream data is represented as Example 24: Facets modify or constrain the acceptable values of a property. For single-valued properties the facets apply to the value of the property. For collection-valued properties the facets apply to the items in the collection. Facets modify or constrain the acceptable values of a type. For single-valued model elements the facets apply to the value of the property. For collection-valued model elements the facets apply to the items in the collection. A Boolean value specifying whether the property can have the value Facets modify or constrain the acceptable values of a property. For single-valued properties the facets apply to the value of the property. For collection-valued properties the facets apply to the items in the collection. Facets modify or constrain the acceptable values of a type. For single-valued model elements the facets apply to the value of the property. For collection-valued model elements the facets apply to the items in the collection. A Boolean value specifying whether the property can have the value Facets modify or constrain the acceptable values of a type. For single-valued model elements the facets apply to the value of the property. For collection-valued model elements the facets apply to the items in the collection. For single-valued model elements the facets apply to the value of the model element. For collection-valued model elements the facets apply to the items in the collection. A Boolean value specifying whether the property can have the value Facets modify or constrain the acceptable values of a type. For single-valued model elements the facets apply to the value of the property. For collection-valued model elements the facets apply to the items in the collection. For single-valued model elements the facets apply to the value of the model element. For collection-valued model elements the facets apply to the items in the collection. A Boolean value specifying whether the property can have the value Facets modify or constrain the acceptable values of a type. Facets modify or constrain the acceptable values of a model element's type. For single-valued model elements the facets apply to the value of the model element. For collection-valued model elements the facets apply to the items in the collection. A Boolean value specifying whether the property can have the value Facets modify or constrain the acceptable values of a type. Facets modify or constrain the acceptable values of a model element's type. For single-valued model elements the facets apply to the value of the model element. For collection-valued model elements the facets apply to the items in the collection. A Boolean value specifying whether the property can have the value Facets modify or constrain the acceptable values of a model element's type. Facets modify or constrain the acceptable values for a model element of a given type. For single-valued model elements the facets apply to the value of the model element. For collection-valued model elements the facets apply to the items in the collection. A Boolean value specifying whether the property can have the value Facets modify or constrain the acceptable values of a model element's type. Facets modify or constrain the acceptable values for a model element of a given type. For single-valued model elements the facets apply to the value of the model element. For collection-valued model elements the facets apply to the items in the collection. A Boolean value specifying whether the property can have the value To update an individual entity, the client makes a Services SHOULD support The semantics of The semantics of Services MAY additionally support For requests with an Updating a dependent property that is tied to a key property of the principal entity through a referential constraint updates the relationship to point to the entity with the specified key value. If there is no such entity, the update fails.9 Str
media*
control information.mediaContentType
MUST be present to indicate how the included stream property value is represented. Stream property values of media type application/json
or one of its subtypes, optionally with format parameters, are represented as native JSON. Values of top-level type text
, for example text/plain
, are represented as a string, with JSON string escaping rules applied. Included stream data of other media types is represented as a base64url-encoded string value, see RFC4648, section 5.mediaContentType
MUST be present to indicate how the included stream property value is represented. Stream property values of media type application/json
or one of its subtypes, optionally with format parameters, are represented as native JSON. Values of top-level type text
with an explicit or default charset
of utf-8
or us-ascii
, for example text/plain
, are represented as a string, with JSON string escaping rules applied. Included stream data of other media types is represented as a base64url-encoded string value, see RFC4648, section 5.null
and the control information mediaContentType
is not necessary.O|Q@5Pt}%!m3a%TtYq{q8X=Ph({WPzo*tQYfY*
zo<{-}iZKgW9%FO|Q@5Pt}%!m3a%TtYq{q8X=Ph({WPzo*tQYfY*
zo<{-}iZKgW9%F
$Type
and }7.2 Type Facets
-7.2.1 Nullable
null
. Attribute
Type<
Property Name="Units" Type="Collection(Edm.String)" /> <
7.2 Type Facets
-7.2.1 Nullable
null
.
$Type
and 7.2 Type Facets
7.2.1 Nullable
null
. Attribute
Type<
7.2 Type Facets
7.2.1 Nullable
null
.
$Type
and }7.2 Type Facets
-7.2.1 Nullable
null
. Attribute
Type<
Property Name="Units" Type="Collection(Edm.String)" /> <
7.2 Type Facets
-7.2.1 Nullable
null
.
$Type
and }7.2 Type Facets
-7.2.1 Nullable
null
. Attribute
Type<
Property Name="Units" Type="Collection(Edm.String)" /> <
7.2 Type Facets
-7.2.1 Nullable
null
.11.4.3 Update an Entity
PATCH
or PUT
request to a URL that identifies the entity. Services MAY restrict updates only to requests addressing the edit URL of the entity.PATCH
as the preferred means of updating an entity. PATCH
provides more resiliency between clients and services by directly modifying only those values specified by the client.PATCH
, as defined in RFC5789, is to merge the content in the request payload with the entity's current state, applying the update only to those components specified in the request body. Collection properties and primitive properties provided in the payload corresponding to updatable properties MUST replace the value of the corresponding property in the entity or complex type. Missing properties of the containing entity or complex property, including dynamic properties, MUST NOT be directly altered unless as a side effect of changes resulting from the provided properties.PATCH
, as defined in RFC5789, is to merge the content in the request payload with the entity's current state, applying the update only to those components specified in the request body. Collection properties and primitive properties provided in the payload corresponding to updatable properties MUST replace the value of the corresponding property in the entity or complex type. Complex properties are updated by applying PATCH
semantics recursively, see also section 11.4.9.3. Missing properties of the containing entity or complex property, including dynamic properties, MUST NOT be directly altered unless as a side effect of changes resulting from the provided properties.PUT
but should be aware of the potential for data-loss in round-tripping properties that the client may not know about in advance, such as open or added properties, or properties not specified in metadata. Services that support PUT
MUST replace all values of structural properties with those specified in the request body. Missing non-key, updatable structural properties not defined as dependent properties within a referential constraint MUST be set to their default values. Omitting a non-nullable property with no service-generated or default value from a PUT
request results in a 400 Bad Request
error. Missing dynamic structural properties MUST be removed or set to null
.OData-Version
header with a value of 4.01
or greater, the media stream of a media entity can be updated by specifying the base64url-encoded representation of the media stream as a virtual property $value
.Updating a primitive property or a complex property with a null value also sets the property to null.
A successful PATCH
request to the edit URL for a complex typed property updates that property. The request body MUST contain a single valid representation for the target complex type.
A successful PATCH
request to the edit URL for a complex typed property updates that property. The request body MUST contain a single valid representation for the target complex type or one of its derived types.
The service MUST directly modify only those properties of the complex type specified in the payload of the PATCH
request.
A complex-typed property can be set to different type in a PATCH
request by specifying a different type in the update payload. Properties shared through inheritance, as well as dynamic properties, are retained (unless overwritten by new values in the payload). Other properties of the original type are discarded.
The service MAY additionally support clients sending a PUT
request to a URL that specifies a complex type. In this case, the service MUST replace the entire complex property with the values specified in the request body and set all unspecified properties to their default value.
Upon successful completion the service responds with either 200 OK
or 204 No Content
. The client may request that the response SHOULD include a body by specifying a Prefer header with a value of return=representation
.
Services MUST return an error if the property is not updatable.
diff --git a/docs/odata-protocol/odata-protocol.md b/docs/odata-protocol/odata-protocol.md index a21c32f45..d408b7910 100644 --- a/docs/odata-protocol/odata-protocol.md +++ b/docs/odata-protocol/odata-protocol.md @@ -4237,8 +4237,10 @@ the content in the request payload with the entity's current state, applying the update only to those components specified in the request body. Collection properties and primitive properties provided in the payload corresponding to updatable properties MUST replace the value of -the corresponding property in the entity or complex type. Missing -properties of the containing entity or complex property, including +the corresponding property in the entity or complex type. +Complex properties are updated by applying `PATCH` semantics recursively, +see also [section 11.4.9.3](#UpdateaComplexProperty). +Missing properties of the containing entity or complex property, including dynamic properties, MUST NOT be directly altered unless as a side effect of changes resulting from the provided properties. @@ -4755,11 +4757,15 @@ property to null. A successful `PATCH` request to the edit URL for a complex typed property updates that property. The request body MUST contain a single -valid representation for the target complex type. +valid representation for the target complex type or one of its derived types. The service MUST directly modify only those properties of the complex type specified in the payload of the `PATCH` request. +A complex-typed property can be set to different type in a `PATCH` request by specifying a different type in the update payload. +Properties shared through inheritance, as well as dynamic properties, are retained (unless overwritten by new values in the payload). +Other properties of the original type are discarded. + The service MAY additionally support clients sending a `PUT` request to a URL that specifies a complex type. In this case, the service MUST replace the entire complex property with the values specified in the diff --git a/odata-protocol/11.4 Data Modification.md b/odata-protocol/11.4 Data Modification.md index c08b936db..6771e8092 100644 --- a/odata-protocol/11.4 Data Modification.md +++ b/odata-protocol/11.4 Data Modification.md @@ -313,8 +313,10 @@ the content in the request payload with the entity's current state, applying the update only to those components specified in the request body. Collection properties and primitive properties provided in the payload corresponding to updatable properties MUST replace the value of -the corresponding property in the entity or complex type. Missing -properties of the containing entity or complex property, including +the corresponding property in the entity or complex type. +Complex properties are updated by applying `PATCH` semantics recursively, +see also [section ##UpdateaComplexProperty]. +Missing properties of the containing entity or complex property, including dynamic properties, MUST NOT be directly altered unless as a side effect of changes resulting from the provided properties. @@ -831,11 +833,17 @@ property to null. A successful `PATCH` request to the edit URL for a complex typed property updates that property. The request body MUST contain a single -valid representation for the target complex type. +valid representation for the target complex type or one of its derived types. The service MUST directly modify only those properties of the complex type specified in the payload of the `PATCH` request. +A complex-typed property can be set to different type in a `PATCH` request +by specifying a different type in the update payload. +Properties shared through inheritance, as well as dynamic properties, +are retained (unless overwritten by new values in the payload). +Other properties of the original type are discarded. + The service MAY additionally support clients sending a `PUT` request to a URL that specifies a complex type. In this case, the service MUST replace the entire complex property with the values specified in the From f51a30738b1d1bc91277c1bc105c8a5b2061eb83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20Thei=C3=9Fen?=Example 2: model for api-1
with snapshot entity sets (hidden application time), key properties marked with {id}
and
Example 3: model for api-2
with timeline entity sets (visible application time), key properties marked with {id}
Both API models in the previous section are views on the same underlying data. A possible storage model for this data is:
Example 4: simple storage model: object key in dark green, temporal sub-key in light green, foreign keys in orange, non-key fields in blue
The period start date is used as the temporal sub-key for identifying time slices together with the key of the temporal object.
Note: alternatively, the period end date could have been used as temporal sub-key, or the primary key of the time slice tables could have been an artificial key (sequence number, UUID, ...) with both the temporal object key and the period boundaries as non-key fields.
The following example data will be used to further illustrate the capabilities introduced by this extension. It assumes that the example services only support four-digit years.
diff --git a/docs/odata-temporal-ext/odata-temporal-ext.md b/docs/odata-temporal-ext/odata-temporal-ext.md index 0716934f4..067818a30 100644 --- a/docs/odata-temporal-ext/odata-temporal-ext.md +++ b/docs/odata-temporal-ext/odata-temporal-ext.md @@ -372,7 +372,7 @@ Example 2: model for `api-1` with snapshot entit application time), key properties marked with {id} ::: - +![API-1](./images/api-1.drawio.svg) and @@ -381,7 +381,8 @@ Example 3: model for `api-2` with timeline entit application time), key properties marked with {id} ::: - +![API-2](./images/api-2.drawio.svg) + ## 2.2 Example Data @@ -393,7 +394,7 @@ Example 4: simple storage model: object key in dark green, temporal sub-key in light green, foreign keys in orange, non-key fields in blue ::: - +![DB](./images/db.drawio.svg) The period start date is used as the temporal sub-key for identifying time slices together with the key of the temporal object. diff --git a/lib/build.js b/lib/build.js index ca1371e42..b538990d6 100644 --- a/lib/build.js +++ b/lib/build.js @@ -10,6 +10,13 @@ iterator(function (srcname, name, variant, meta) { fs.cpSync(`${__dirname}/../styles`, `${__dirname}/../docs/${name}/styles`, { recursive: true, }); + const srcImages = `${__dirname}/../${srcname}/images`; + if (fs.existsSync(srcImages)) { + const targetImages = `${__dirname}/../docs/${name}/images`; + if (fs.existsSync(targetImages)) + fs.rmSync(targetImages, { recursive: true }); + fs.cpSync(srcImages, targetImages, { recursive: true }); + } var md = fs.createWriteStream(`${__dirname}/../docs/${name}/${name}.md`); var html = pandoc({ "--metadata-file": `${__dirname}/../${srcname}/${variant}.yaml`, diff --git a/lib/server.js b/lib/server.js index c9e90dcae..4a77120ff 100644 --- a/lib/server.js +++ b/lib/server.js @@ -13,15 +13,16 @@ const connectLivereload = require("connect-livereload"); var app = express() .use(connectLivereload()) - .use("/styles", express.static(`${__dirname}/../styles`)) .get("/", function (_req, res, _next) { var docs = []; iterator(function (srcname, name, variant) { - docs.push(`