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

Add some examples based on STP #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions binary/examples/stp-collection-after8.cbord
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/ This is part of the stp-collection example /

[
[2, 6(23 / container:item /), cri'./9'],
[2, 6(23 / container:item /), cri'./10'],
[2, 6(23 / container:item /), cri'./11'],
[2, 6(23 / container:item /), cri'./12'],
[2, 6(23 / container:item /), cri'./13'],
[2, 6(42 / stp:next /), cri'stp-collection-after8.cbord']
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
[2, 6(42 / stp:next /), cri'stp-collection-after8.cbord']

]
16 changes: 16 additions & 0 deletions binary/examples/stp-collection.cbord
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/ What could STP (Series Transfer Pattern) look like in CoRAL? /
/ /
/ This assumes a basic collection pattern, applied to a long list of /
/ very generic resources. /

[
[2, 6(23 / container:item /), cri'./1'],
[2, 6(23 / container:item /), cri'./2'],
[2, 6(23 / container:item /), cri'./3'],
[2, 6(23 / container:item /), cri'./4'],
[2, 6(23 / container:item /), cri'./5'],
[2, 6(23 / container:item /), cri'./6'],
[2, 6(23 / container:item /), cri'./7'],
[2, 6(23 / container:item /), cri'./8'],
[2, 6(42 / stp:next /), cri'stp-collection-after8.cbord']
]
12 changes: 12 additions & 0 deletions binary/examples/stp-index-0.cbord
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/ This is part of the stp-index example /

[
/ Actually, rather than just sending the embedded representation, could have sent the bare value just as well /
[2, 6(0 / coral:current-representation), 6.1668546672(
/ 1668546560 + 112 for application/senml+cbor /
[
{-2 / bn /: "urn:dev:...", -4 / "bu" /: "Cel", -3 / "bt": 1234567890, 2 / "v" /: 39.1},
{ / ... /}
]
)]
]
13 changes: 13 additions & 0 deletions binary/examples/stp-index-1.cbord
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/ This is part of the stp-index example /

[
/ Not indicating this is growing any more /
[2, 6(42 / stp:next /), cri'stp-index-0.cbord'],
[2, 6(0 / coral:current-representation), 6.1668546672(
/ 1668546560 + 112 for application/senml+cbor /
[
{-2 / bn /: "urn:dev:...", -4 / "bu" /: "Cel", -3 / "bt": 1234571490, 2 / "v" /: 39.1},
{ / ... /}
]
)]
]
16 changes: 16 additions & 0 deletions binary/examples/stp-index-2.cbord
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/ This is part of the stp-index example /

[
/ Yes I'm still growing (independenlty of whether you just observe /
/ me or not) /
[2, 6(10 / core:obs /), true],
[2, 6(42 / stp:next /), cri'stp-index-1.cbord'],
/ Alternatively to an embedded representation, multipart would just be another option /
[2, 6(0 / coral:current-representation), 6.1668546672(
Copy link
Member Author

@chrysn chrysn Nov 19, 2021

Choose a reason for hiding this comment

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

Suggested change
[2, 6(0 / coral:current-representation), 6.1668546672(
[2, 6(0 / coral:current-representation /), 1668546672(

/ 1668546560 + 112 for application/senml+cbor /
[
{-2 / bn /: "urn:dev:...", -4 / "bu" /: "Cel", -3 / "bt": 1234575090, 2 / "v" /: 39.1},
{ / ... /}
]
)]
]
23 changes: 23 additions & 0 deletions binary/examples/stp-index.cbord
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/ What could STP (Series Transfer Pattern) look like in CoRAL? /
/ /
/ This assumes a series that is not expressed natively in CoRAL but /
/ by representations in another format (SenML). It pagination from a /
/ head, packs representations in together with the CoRAL, and also /
/ explores a form for random access. /

[
[2, 6(42 / stp:next /), cri'stp-index-2.cbord', [
/ Being still observable means it's still growing. /
[2, 6(10 / core:obs /), true]
]],
[2, 6(55 / stp:search /), null, [
/ Form that describes how /
[2, 6(81 / form:target /), cri'cgi-bin/stp-index-search.php'],
[2, 6(82 / form:method /), 6(825 / FETCH /)],
[2, 6(83 / form:builder /), 6(559 / form:build-a-senml-fetch-out-of-what-you-are-looking-for /)],
]],
/ I seriously doubt anyone wants CRI templates, so this is in URI template /
/ form. High data rate parallel fetchers might still want to use that /
/ information. /
[2, 6(56 / stp:all-are-of-this-form /), "stp-index-{linear}.cbord"]]
]