Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atnaujinta pagal LDES pakeitimus #24

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions openapi/components/parameters/cid.yaml

This file was deleted.

17 changes: 2 additions & 15 deletions openapi/components/parameters/query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |

Query example:

```?code=42&country.name=Lithuania&country.continent.name=Europe&_sort=-code,country.name&_limit=10&_select=name,country.name,country.continent.name```
```?code=42&country.name=Lithuania&country.continent.name=Europe&_sort=-code,country.name&_select=name,country.name,country.continent.name```

```?_select=_id,_rev&code._gt=42,country._id=26ae559c-e650-4e0d-90da-5c0907dcb9fd,&_or=1&code=1&code=2,&_count=```
schema:
Expand Down Expand Up @@ -75,15 +75,6 @@ schema:
source. An attempt to join data from multiple data sources,
should return an error.

_limit:
type: integer
examples:
- 10
description: |
Limit result to given number of objects.

If `_sort` is not given, then sorty by `_id`.

_sort:
type: string
examples:
Expand All @@ -110,8 +101,4 @@ schema:
}
```
_page:
type: string
description: |
If _limit is set and results in multiple pages of results to be available, _page value is returned as part of the response, linking to the next page after the current set. This value can be used directly for example `&page="WyIxOTAzNmM0ZS1mZmIyLTQyMTAtYjIyMi01YTJkZDQ2MWU5MzQiXQ=="`. Or through a next page request `&page.next`.

Recommeded format `base64` - `base64(json([v1, v2, ...]))`
$ref: ../schemas/_view.yaml
12 changes: 12 additions & 0 deletions openapi/components/schemas/_relation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: object
description: A tree:GreaterThanOrEqualToRelation element
properties:
path:
type: string
format: sosa:resultTime
node:
type: string
description: A tree:node string that provides a query string to be used to retrieve this page (Node)
value:
type: string
format: xsd:dateTime
13 changes: 13 additions & 0 deletions openapi/components/schemas/_view.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type: string
description: |
A tree:view element represented as a string that provides a query string was used to retrieve this page (Node) in the result tree. <?page=1> is used for first (default) node of the tree
properties:
_node:
type: object
description: A tree:Node object representing this nodes relations to other nodes in the tree
properties:
relation:
type: array
description: A tree:relation element
items:
$ref: ./_relation.yaml
45 changes: 14 additions & 31 deletions openapi/components/schemas/change.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,23 @@
type: object
description: |
A tree:member element that represents an immutable instance of an object

This is usualy a version of an object within the data. Changes to the object result in new versions of this object to be created and added to the tree.

Latest version of the object can be determined by _issued date
properties:
_cid:
type: integer
examples:
- 11
_id:
type: string
description: UUID of the object instance
format: uuidv4
examples:
- abdd1245-bbf9-4085-9366-f11c0f737c1d
_rev:
type: string
format: uuidv4
examples:
- 16dabe62-61e9-4549-a6bd-07cecfbc3508
_txn:
type: string
examples:
- 792a5029-63c9-4c07-995c-cbc063aaac2c
_created:
- "abdd1245-bbf9-4085-9366-f11c0f737c1d"
_issued:
type: string
format: datetime
format: xsd:dateTime
examples:
- '2021-07-30T14:03:14.645198'
_op:
type: string
enum:
- insert
- patch
- delete
_objectType:
- "2021-07-30T14:03:14.645198Z"
_isVersionOf:
type: string
examples:
- Continent
_value:
type: string
examples:
- Europe
additionalProperties: false
description: An element that this member is a version of
additionalProperties: false
14 changes: 11 additions & 3 deletions openapi/components/schemas/changes.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
type: object
description: |
Changes are presented back as a [LDES](https://semiceu.github.io/LinkedDataEventStreams/) Event Stream.

Changes is an ```ldes:EventStream``` object
properties:
_type:
$ref: ./_type.yaml
_data:
_shape:
type: string
description: A tree:shape element represented as a string that provides a relative path to the corresponding {name}.schacl shape document.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UDTS yra JSON REST API, klausimas iš kur gausime SHACL?

_member:
type: array
description: A collection of one or many tree:member elements
items:
$ref: ./change.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Klausimas ar mums tikrai reikia atskiro _member, ar neužtenka _data ir @context, kuris visus objektus deklaruotų kaip tree:member?

Nes dabar API gausis per daug fragmentuotas: event streem -> members -> change. Reika labai daug užklausų, kad gauti duomenis.

_view:
$ref: ./_view.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Siūlau palikti, dabartinį _next pavadinimą, o tree:view nurodyti JSON-LD kontekste.

2 changes: 1 addition & 1 deletion openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ paths:
$ref: paths/wipe.yaml
/{group}/{form}/{org}/{catalog}/{dataset}/{version}/{model}/{id}/{property}:
$ref: paths/property.yaml
/{group}/{form}/{org}/{catalog}/{dataset}/{version}/{model}/:changes/{cid}:
/{group}/{form}/{org}/{catalog}/{dataset}/{version}/{model}/:changes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jei panaikiname puslapiavimą, pagal keitimo id, klausimas, kaip gausime sekantį puslaptį?

$ref: paths/changes.yaml
/services/{form}/{org}/{catalog}/{dataset}/{version}/{service}:
$ref: paths/service.yaml
Expand Down
23 changes: 3 additions & 20 deletions openapi/paths/changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ parameters:
- $ref: ../components/parameters/dataset.yaml
- $ref: ../components/parameters/version.yaml
- $ref: ../components/parameters/model.yaml
- $ref: ../components/parameters/cid.yaml
- $ref: ../components/parameters/traceparent.yaml
- $ref: ../components/parameters/tracestate.yaml
- $ref: ../components/parameters/If-None-Match.yaml
Expand All @@ -16,25 +15,11 @@ get:
- change
security:
- {}
summary: Get all object changes since given {cid} (change id).
summary: Get all object changes
description: |
Get latest changes to a table.
Get all changes for this object as an ldes:EventStream object that conforms to [LDES](https://semiceu.github.io/LinkedDataEventStreams/)

If {cid} is not given, return changes, since very first available
change.

If {cid} is gven, return only changes, since given change id, including
change id itself.

This API can return changes, that were returned previously, client
should be responsible for checking if a change was received previously
or not.

Last change id is included in the request, in order for clients to check
if last change id matches change received by client. If last change
does not match, then client should do a full synce, because if last
change id does not match, that means, that a data migration or some
other alterations to data were made, which requires to do a full sync.
Depending on the size response might be paginated and accessed via querie ```?page=n``` where ```n``` is the page (node) number starting with 1
operationId: getChanges
responses:
'200':
Expand All @@ -51,5 +36,3 @@ get:
$ref: ../components/responses/error500.yaml
'503':
$ref: ../components/responses/error503.yaml
externalDocs:
url: https://atviriduomenys.readthedocs.io/api/index.html#changes