You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: specs/index.bs
+176-19
Original file line number
Diff line number
Diff line change
@@ -131,6 +131,12 @@ Advisement: The current technical specifications are undergoing continuous refin
131
131
:: See [Pathfinder Tech Specs](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#host-system) for the definition.
132
132
Here, a host system additionally implements support for 1 or more data transactions ([[#txns]]).
133
133
134
+
: <dfn>Data Owner</dfn>
135
+
:: See [Pathfinder Tech Specs](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#data-owner) for the definition.
136
+
137
+
: <dfn>Data Recipient</dfn>
138
+
:: See [Pathfinder Tech Specs](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#data-recipient) for the definition.
139
+
134
140
: <dfn>ShipmentFootprint</dfn>
135
141
:: See [[#dt-sf]] for the definition.
136
142
@@ -149,7 +155,12 @@ Advisement: The current technical specifications are undergoing continuous refin
149
155
150
156
: <dfn>PCF</dfn>
151
157
::
152
-
Product Carbon Footprint. See [Pathfinder Tech Specs](https://wbcsd.github.io/tr/data-exchange-protocol/#dt-carbonfootprint) for further details.
158
+
Product Carbon Footprint. See [Pathfinder Tech Specs](https://wbcsd.github.io/tr/data-exchange-protocol/#dt-carbonfootprint) for further details
159
+
160
+
: <dfn>Access Token</dfn>
161
+
:: :: See [Pathfinder Tech Specs](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#access-token) for the definition.
162
+
163
+
Issue: add a pathfinder tech specs normative reference to this document
153
164
154
165
# Business Cases # {#business-cases}
155
166
@@ -535,7 +546,7 @@ The highlighted lines show 2 TCEs which `Z` has collected and calculated for `S`
535
546
536
547
# Data Model # {#data-model}
537
548
538
-
ISSUE: Add a brief Intro to the data model? Potentially with brief diagram or explanation on how shipment, TCE, TOC etc. relate to each other?
549
+
ISSUE: Add a brief Intro to the data model? Potentially with brief diagram or explanation on how shipment, TCE, TOC etc. relate to each other?
539
550
540
551
## ShipmentFootprint ## {#dt-sf}
541
552
@@ -547,7 +558,7 @@ By collecting 1 or more ShipmentFootprint for a shipment from [=Transport Operat
547
558
a [=Transport Service User=] can construct Transport Chains ([=TCs=]), and thereby calculate
548
559
logistics emissions.
549
560
550
-
ISSUE: The way the above paragraphs are defined might lead to confusion.
561
+
ISSUE: The way the above paragraphs are defined might lead to confusion.
551
562
552
563
To calculate a ShipmentFootprint, the [=Transport Operator=] or [=Transport Service Organizer=] MUST
553
564
@@ -587,7 +598,7 @@ A ShipmentFootprint has the following properties:
587
598
<td><dfn>typeOfItems</dfn>
588
599
<td>String
589
600
<td>O
590
-
<td>The type of units the shipment, including the goods transported and any packaging provided by the [=Transport Service User=], is composed of. For example, boxes, pallets, bottles, etc.
601
+
<td>The type of units the shipment, including the goods transported and any packaging provided by the [=Transport Service User=], is composed of. For example, boxes, pallets, bottles, etc.
591
602
<tr>
592
603
<td><dfn>shipmentId</dfn>
593
604
<td>String
@@ -894,8 +905,8 @@ The Data Type <{TOC}> has the following properties:
894
905
<td>
895
906
896
907
<tr>
897
-
<td><dfn>loadFactor</dfn>
898
-
<td>Number
908
+
<td><dfn>loadFactor</dfn> : [=Decimal=]
909
+
<td>String
899
910
<td>O
900
911
<td>
901
912
Ratio of the mass of the actual load to the maximum legally authorized load of a particular vehicle on a TOC level.
@@ -904,8 +915,8 @@ The Data Type <{TOC}> has the following properties:
904
915
The value of this property must be between `0` (excluding) and `1` (including).
905
916
906
917
<tr>
907
-
<td><dfn>emptyDistanceFactor</dfn>
908
-
<td>Number
918
+
<td><dfn>emptyDistanceFactor</dfn> : [=Decimal=]
919
+
<td>String
909
920
<td>O
910
921
<td>
911
922
Ratio of the section of the route of a vehicle during which no freight is transported over the total distance (loaded plus empty distance) of a vehicle on a TOC level
@@ -1514,22 +1525,170 @@ The following properties are defined for data type <dfn element>Feedstock</dfn>:
1514
1525
</table>
1515
1526
</figure>
1516
1527
1517
-
# Pathfinder Integration # {#pcf-mapping}
1528
+
# HTTP REST API # {#http-rest-api}
1518
1529
1519
-
The Data types defined in [[#data-model]] are specific to [[!ISO14083]] and the [[!GLEC]] Framework.
1520
-
1521
-
This chapter specifies the integration of the data types <{ShipmentFootprint}> and <{TOC}> into the Pathfinder Data Model ([[!PACTDX]] Chapter 4).
1522
-
1523
-
By doing so, the existing data exchange protocol ([[!PACTDX]] Network API (see Chapter 6) can be re-used for logistics emissions data exchange as well.
1530
+
The exchange of logistics emissions data throught the [[#data-model]] presupposes the implementation of the HTTP REST API defined in [[!PACTDX]] (Chapter 6).
1524
1531
1525
-
Such re-use simplifies the integration of logistics emissions data into existing [=host systems=] software, especially if they are already used by [=Transport Service Users=].
1532
+
Reusing the [[!PACTDX]] data exchange protocol simplifies the integration of logistics emissions data into existing [=host systems=] software, especially if they are already used by [=Transport Service Users=].
1526
1533
1527
1534
They can then use 1 interoperable API for the exchange of different categories of carbon emissions data related to GHG Protocol lifecycle stages (such as material acquisition and transport).
1528
1535
1529
1536
Additionally, by mapping the GLEC Data model into the [[!PACTDX]] data model, existing [=host systems=] can be gradually extended to support calculation of logistics emissions in accordance with the [[!GLEC]] Framework and [[!ISO14083]].
1530
1537
1538
+
A [=host system=] MUST implement:
1539
+
1. The endpoint for the exchange of [=Transport Activity Data=] (see [[#action-tad]]); and
1540
+
1. The exchange of <{ShipmentFootprint}> and <{TOC}> as specified in [[#pcf-mapping]].
1541
+
1542
+
## Action TransportActivityData ## {#action-tad}
1543
+
1544
+
Lists the [=data owner=]'s [=Transport Activity Data=] with [[#pagination]] and optional [[#filtering]]
1545
+
1546
+
A [=Host system=] SHOULD implement an access management system to return only the [=transport activity data=] intended for the requesting [=data recipient=].
1547
+
1548
+
### Filtering ### {#filtering}
1549
+
1550
+
Filtering CAN be requested by a [=data recipient=] by supplying a [=filter statement=] through the [=Filter=] request parameter.
1551
+
1552
+
Note: The filter statement syntax is described at the [=Filter=] request parameter.
1553
+
1554
+
If a [=host system=] does not implement filtering, it MUST process the request as if no [=Filter=] was provided.
1555
+
1556
+
If a [=host system=] implements filtering, it CAN process the filter statement on a best-effort basis:
1557
+
1558
+
1. it CAN ignore the filter statement or parts of the filter statement, or
1559
+
1. it CAN return an error response as defined in the [Pathfinder Technical Specifications](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#api-error-responses).
1560
+
For instance, a host system CAN return an error with code `NotImplemented` if it does not support a specific filter pair.
1561
+
1. it CAN treat concatenated filters disjunctively, i.e., returning the union of the results of the individual filters.
1562
+
1563
+
1564
+
### Pagination ### {#pagination}
1565
+
1566
+
[=Host systems=] MUST implement pagination server-side such that
1567
+
1568
+
1. The host system MAY return less [=Transport Activity Data=] than requested through the [=Limit=] request parameter
1569
+
1. The host system MUST return a `Link` header if there is additional [=Transport Activity Data=] ready to be retrieved, such that
1570
+
1. The `Link` header conforms to [[!RFC8288]]
1571
+
1. The value of the `rel` parameter is equal to `next`
1572
+
1. the target IRI (RFC8288, section 3.1) of the `Link` header is absolute
1573
+
1. The value of `host` of the target IRI is equal to the value of the `host` request header from the original `TransportActivityData` HTTP request
1574
+
1575
+
The target IRI from a pagination `link` header is called a <dfn>pagination link</dfn>.
1576
+
1577
+
Upon a [=host system=] returning a [=pagination link=]
1578
+
1579
+
1. a data recipient CAN call the pagination link more than once
1580
+
1. upon each call, the host system
1581
+
1. MUST return the same Transport Activity Data upon successful authentication (i.e. a Bearer token authentication as defined in [[!PACTDX]] Section 6.3)
1582
+
1. MUST NOT return more data than requested in case [=Limit=] was defined by a [=data recipient=]
1583
+
1. MUST return a `Link` header conforming with the previous description in case there is additional Transport Activity Data available
1584
+
1. If a response contains a second pagination link and the data recipient upon calling the second pagination link, the previous pagination link MAY no longer work
1585
+
- i.e. data recipients MUST NOT assume that previous pagination links continue to return results after advancing in the pagination process
1586
+
1. a pagination link MUST be valid for at least 180 seconds after creation
1587
+
1. a data recipient SHOULD retry calling the pagination link after the server returned an error
1588
+
1. and SHOULD use a randomized exponential back-off strategy when retrying
1589
+
1590
+
### Request Syntax ### {#action-tad-request}
1591
+
1592
+
<pre highlight=http>
1593
+
GET <l>[=Subpath=]</l>/2/ileap/tad?<l>[=Filter=]</l>&<l>[=Limit=]</l> HTTP/1.1
1594
+
host: <l>[=Hostname=]</l>
1595
+
authorization: Bearer <l>[=BearerToken=]</l>
1596
+
</pre>
1597
+
1598
+
: <dfn>Subpath</dfn>
1599
+
:: If a host system uses a relative subpath, then the requesting data recipient MUST prepend this subpath.
1600
+
1601
+
: <dfn>Hostname</dfn>
1602
+
:: The requesting data recipient MUST use the domain name of the host system.
1603
+
1604
+
: <dfn>BearerToken</dfn>
1605
+
:: See [[!PACTDX]] section 6.3 Authentication Flow.
1606
+
1607
+
: <dfn>Filter</dfn>
1608
+
::
1609
+
`Filter` is an OPTIONAL request parameter containing a filter statement.
1610
+
A <dfn>filter statement</dfn> is a list of name-value filter pairs.
1611
+
Each filter pair has a `$name=$value` syntax where `$name` is the (case-sensitive) name
1612
+
of the field to filter by, and `$value` the (case-insensitive) value to filter for.
1613
+
Filter pairs CAN be concatenated with `&`.
1531
1614
1532
-
## ServiceFootprint ## {#pcf-mapping-sf}
1615
+
<div class=example>
1616
+
Get transport activity data with [=Feedstock=] `"Fossil"` and <{TAD/packagingOrTrEqType}> `"Pallet"`
1617
+
1618
+
```http
1619
+
GET /2/ileap/tad?feedstock=Fossil&packagingOrTrEqType=pallet HTTP/1.1
1620
+
```
1621
+
</div>
1622
+
1623
+
: <dfn>Limit</dfn>
1624
+
::
1625
+
`Limit` is an OPTIONAL request parameter. If defined,
1626
+
1. the name of the HTTP request parameter MUST be `limit`
If the host system returns transport activity data, the `HttpStatusCode` MUST be 200.
1660
+
1661
+
If the host system responds with an error response, the `HttpStatusCode` MUST match the HTTP Status Code of the respective error response code, as defined in the [Pathfinder Technical Specifications](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#api-error-responsesm).
1662
+
1663
+
: <dfn>TadStatusText</dfn>
1664
+
::
1665
+
The HTTP Status text conforming to the HTTP status code [=TadStatusCode=].
1666
+
1667
+
: <dfn>TadResponseBody</dfn>
1668
+
::
1669
+
If the host system accepts the [=access token=], the body MUST be a JSON object with property `data` with value the list of [=Transport Activity Data=].
1670
+
The list MUST be encoded as a JSON array.
1671
+
1672
+
If the host system does not accept the access token, the body MUST be an error response with code [AccessDenied](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#accessdenied).
1673
+
1674
+
If the host system does not accept the access token because it expired, the body SHOULD be an error response with code [TokenExpired](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#tokenexpired).
1675
+
1676
+
In all other cases, for instance in case of a malformed value of the header authorization, the body SHOULD be an error response with code [BadRequest](https://wbcsd.github.io/tr/2023/data-exchange-protocol-20231207/#badrequest).
1677
+
1678
+
: <dfn>ContentLength</dfn>
1679
+
:: The length of the Body. See [[!rfc9112]].
1680
+
1681
+
: <dfn>PaginationLink</dfn>
1682
+
:: see [=pagination link=] and [[#pagination]].
1683
+
1684
+
1685
+
## Pathfinder Integration ## {#pcf-mapping}
1686
+
1687
+
The Data types defined in [[#data-model]] are specific to [[!ISO14083]] and the [[!GLEC]] Framework.
1688
+
1689
+
This section specifies the integration of the data types <{ShipmentFootprint}> and <{TOC}> into the Pathfinder Data Model ([[!PACTDX]] Chapter 4).
1690
+
1691
+
### ServiceFootprint ### {#pcf-mapping-sf}
1533
1692
1534
1693
Note: This chaper refers to the PACT Data Model. See [[!PACTDX]] Chapter 4 for further details.
1535
1694
@@ -1625,12 +1784,10 @@ Note: Chapter [[#appendix-a-sf-example]] contains an example.
1625
1784
<figcaption>Mapping of PACT Data Model properties to <{ShipmentFootprint}> properties</figcaption>
1626
1785
</figure>
1627
1786
1628
-
## TOC ## {#pcf-mapping-toc}
1787
+
### TOC ### {#pcf-mapping-toc}
1629
1788
1630
1789
Issue: this sections is still work in progress
1631
1790
1632
-
1633
-
1634
1791
# Appendix A: Example PCFs with iLEAP Data embedded # {#appendix-a}
1635
1792
1636
1793
## ShipmentFootprint example ## {#appendix-a-sf-example}
0 commit comments