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

added simple root Event and fixed OGBillOfLading Generator #164

Merged
merged 15 commits into from
Jun 29, 2021
Merged
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
67 changes: 67 additions & 0 deletions packages/traceability-schemas/schemas/Event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"$id": "https://w3id.org/traceability/schemas/Event.json",
"$schema": "https://json-schema.org/draft-07/schema#",
"$comment": "{\"term\": \"Event\", \"@id\": \"https://schema.org/Event\"}",
"title": "Organization",
"description": "An event such as a transformation, aggregation, commission, etc.",
"type": "object",
"properties": {
"@context": {
"type": "array"
},
"type": {
"oneOf": [
{
"type": "string"
},
{
"type": "array"
}
]
},
"eventType": {
"$comment": "{\"term\": \"eventType\", \"@id\": \"https://schema.org/value\"}",
"title": "Event Type",
"description": "The Type of the Event.",
"type": "string"
},
"eventId": {
"$comment": "{\"term\": \"eventId\", \"@id\": \"https://schema.org/identifier\"}",
"title": "Event Identifier",
"description": "The Identifier of the Event.",
"type": "string"
},
"actor": {
"$comment": "{\"term\": \"actor\", \"@id\": \"https://w3id.org/traceability#Organization\", \"@type\": \"https://schema.org/ItemList\"}",
"title": "Actor",
"description": "The organization performing the activity.",
"type": "array",
"items": {
"$ref": "https://w3id.org/traceability/schemas/Entity.json"
}
},
"place": {
"$comment": "{\"term\": \"place\", \"@id\": \"https://w3id.org/traceability#place\"}",
"title": "Event Location",
"description": "The location where the event took place.",
"$ref": "https://w3id.org/traceability/schemas/Place.json"
},
"eventTime": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we may want to actually record a few more things here (possibly optionally), e.g. scheduled or planned start time, planned duration, actual start time, actual end time, etc. open on this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer ability to record at a minimum

  1. event start time
  2. event end time

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this makes sense to split up, probably another base object that encapsulates eventTime that would have the planned start/duration etc.

"$comment": "{\"term\": \"eventTime\", \"@id\": \"https://schema.org/DateTime#v2\"}",
"title": "Event Time",
"description": "The time when the event took place.",
"type": "string"
},
"products": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am going to have to mull over use of Product here. I think it is probably correct, but also thinking about raw materials becoming a product etc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

see note from @OR13 below - should this be GS1 or schema.org? Other aspects of the vocab are utilizing schema.org

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider "inputs" (raw materials, outputs from other processes/sources, etc.) and "outputs" (refined version of inputs becoming inputs to other processes/consumers, finished products, etc.). These can then be easily turned into a complex trace from most-basic-origin (e.g., extraction of various ores from deep underground) to most-refined-consumable (e.g., a smartphone, tablet, or computer)...

"$comment": "{\"term\": \"products\", \"@id\": \"https://schema.org/Product\"}",
"title": "Products",
"description": "The products referenced by the event.",
"type": "array",
"items": {
"$ref": "https://w3id.org/traceability/schemas/Product.json"
}
}
},
"additionalProperties": false,
"examples": []
}
144 changes: 144 additions & 0 deletions packages/traceability-schemas/src/__fixtures__/Event/bad.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
[
{
"circuit": "bypass",
"sensor": "synthesize"
},
{
"@context": [
"https://w3id.org/traceability/v1"
],
"type": "Event",
"eventType": "commission",
"actor": [
{
"type": "Organization",
"name": "Rowe Inc",
"description": "Realigned directional framework",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"description": "Realigned directional framework",
"description": "Realigned the directional framework.",

"address": {
"type": "PostalAddress",
"streetAddress": "859 Leannon Hill",
"addressLocality": "Port Aryanna",
"addressRegion": "Ohio",
"postalCode": "65217-4733",
"addressCountry": "Macedonia"
},
"email": "[email protected]",
"phoneNumber": "555-535-6270",
"faxNumber": "555-365-1076"
},
{
"type": "Organization",
"name": "Shanahan, Waelchi and Beier",
"description": "Extended the explicit framework.",
"address": {
"type": "PostalAddress",
"streetAddress": "1456 Hermiston Dale",
"addressLocality": "Predovicland",
"addressRegion": "New Hampshire",
"postalCode": "33475-5040",
"addressCountry": "Chad"
},
"email": "[email protected]",
"phoneNumber": "555-893-6731",
"faxNumber": "555-170-9772"
}
],
"place": {
"type": "Place",
"globalLocationNumber": "9213394765603",
"geo": {
"type": "GeoCoordinates",
"latitude": "67.2831",
"longitude": "-148.8169"
},
"address": {
"type": "PostalAddress",
"organizationName": "Ortiz - Kessler",
"streetAddress": "3470 Fritsch Glen",
"addressLocality": "Hermistonview",
"addressRegion": "Florida",
"postalCode": "63684",
"addressCountry": "Saint Helena"
}
},
"products": [
{
"type": "Product",
"manufacturer": {
"type": "Person",
"firstName": "Heloise",
"lastName": "Kuvalis",
"email": "[email protected]",
"phoneNumber": "555-631-4341",
"worksFor": {
"type": "Organization",
"name": "Runolfsdottir LLC",
"description": "Ergonomic 6th generation algorithm",
"address": {
"type": "PostalAddress",
"streetAddress": "27995 Kathlyn Lock",
"addressLocality": "Tyrelborough",
"addressRegion": "Hawaii",
"postalCode": "55412-1858",
"addressCountry": "United Arab Emirates"
},
"email": "[email protected]",
"phoneNumber": "555-803-3775",
"faxNumber": "555-275-8825"
},
"jobTitle": "Regional Branding Analyst"
},
"name": "Tasty Wooden Ball",
"description": "New range of formal shirts, designed keeping you in mind, with fits and styling that will make you stand apart.",
"sizeOrAmount": {
"type": "QuantitativeValue",
"unitCode": "hg/ha",
"value": "5413"
},
"weight": {
"type": "QuantitativeValue",
"unitCode": "hg/ha",
"value": "8186"
},
"sku": "71119993108"
},
{
"type": "Product",
"manufacturer": {
"type": "Organization",
"name": "Farrell, Schimmel and Mills",
"description": "Networked neutral superstructure",
"address": {
"type": "PostalAddress",
"streetAddress": "448 Malvina Crossing",
"addressLocality": "Lefflershire",
"addressRegion": "New York",
"postalCode": "34965",
"addressCountry": "El Salvador"
},
"email": "[email protected]",
"phoneNumber": "555-176-4663",
"faxNumber": "555-504-7099"
},
"name": "Handcrafted Fresh Pizza",
"description": "The Nagasaki Lander is the trademarked name of several series of Nagasaki sport bikes, that started with the 1984 ABC800J.",
"sizeOrAmount": {
"type": "QuantitativeValue",
"unitCode": "hg/ha",
"value": "7247"
},
"weight": {
"type": "QuantitativeValue",
"unitCode": "hg/ha",
"value": "1903"
},
"sku": "88782379145"
}
],
"interface": "override",
"system": "compress"
},
{
"panel": "quantify"
}
]
155 changes: 155 additions & 0 deletions packages/traceability-schemas/src/__fixtures__/Event/credential.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/traceability/v1"
],
"id": "http://example.org/credentials/",
"type": [
"VerifiableCredential"
],
"issuanceDate": "2021-02-04T20:29:37+00:00",
"issuer": "did:key:z6MktHQo3fRRohk44dsbE76CuiTpBmyMWq2VVjvV6aBSeE3U",
"credentialSubject": {
"@context": [
"https://w3id.org/traceability/v1"
],
"type": "Event",
"eventType": "commission",
"eventId": "12345",
"actor": [
{
"type": "Organization",
"name": "White, Howell and Runolfsson",
"description": "Seamless didactic initiative",
"address": {
"type": "PostalAddress",
"streetAddress": "81311 Torphy Groves",
"addressLocality": "Lake Taylor",
"addressRegion": "Oregon",
"postalCode": "75298-4103",
"addressCountry": "Equatorial Guinea"
},
"email": "[email protected]",
"phoneNumber": "555-628-4924",
"faxNumber": "555-192-2412"
},
{
"type": "Organization",
"name": "Keeling - Bergnaum",
"description": "Face to face intermediate matrix",
"address": {
"type": "PostalAddress",
"streetAddress": "656 Buckridge Oval",
"addressLocality": "Cassinhaven",
"addressRegion": "Nebraska",
"postalCode": "27027-6015",
"addressCountry": "Cambodia"
},
"email": "[email protected]",
"phoneNumber": "555-585-9995",
"faxNumber": "555-971-6601"
}
],
"place": {
"type": "Place",
"globalLocationNumber": "1295710388268",
"geo": {
"type": "GeoCoordinates",
"latitude": "-0.1494",
"longitude": "146.3952"
},
"address": {
"type": "PostalAddress",
"organizationName": "Dicki - Berge",
"streetAddress": "7420 Wunsch Rapids",
"addressLocality": "New Marlon",
"addressRegion": "Vermont",
"postalCode": "92487-0853",
"addressCountry": "Bangladesh"
}
},
"eventTime": "",
"products": [
{
"type": "Product",
"manufacturer": {
"type": "Person",
"firstName": "Anna",
"lastName": "Gusikowski",
"email": "[email protected]",
"phoneNumber": "555-349-6434",
"worksFor": {
"type": "Organization",
"name": "Dietrich, Bruen and Kulas",
"description": "Expanded web-enabled initiative",
"address": {
"type": "PostalAddress",
"streetAddress": "2846 Kasey Squares",
"addressLocality": "Mabelside",
"addressRegion": "Pennsylvania",
"postalCode": "61557-1756",
"addressCountry": "Lao People's Democratic Republic"
},
"email": "[email protected]",
"phoneNumber": "555-423-6603",
"faxNumber": "555-465-1090"
},
"jobTitle": "Principal Division Liaison"
},
"name": "Rustic Concrete Hat",
"description": "New range of formal shirts, designed keeping you in mind, with fits and styling that will make you stand apart.",
"sizeOrAmount": {
"type": "QuantitativeValue",
"unitCode": "hg/ha",
"value": "3725"
},
"weight": {
"type": "QuantitativeValue",
"unitCode": "hg/ha",
"value": "268"
},
"sku": "962958370089"
},
{
"type": "Product",
"manufacturer": {
"type": "Person",
"firstName": "Pearl",
"lastName": "Williamson",
"email": "[email protected]",
"phoneNumber": "555-290-5245",
"worksFor": {
"type": "Organization",
"name": "Sporer - Rogahn",
"description": "Re-contextualized composite utilisation",
"address": {
"type": "PostalAddress",
"streetAddress": "8000 Edmund Prairie",
"addressLocality": "Macejkovicside",
"addressRegion": "Indiana",
"postalCode": "36902-7880",
"addressCountry": "Seychelles"
},
"email": "[email protected]",
"phoneNumber": "555-181-5576",
"faxNumber": "555-869-3096"
},
"jobTitle": "Lead Mobility Assistant"
},
"name": "Refined Rubber Bike",
"description": "The beautiful range of Apple Naturalé has an exciting mix of natural ingredients, with the Goodness of 100% Natural Ingredients",
"sizeOrAmount": {
"type": "QuantitativeValue",
"unitCode": "hg/ha",
"value": "3660"
},
"weight": {
"type": "QuantitativeValue",
"unitCode": "hg/ha",
"value": "8418"
},
"sku": "115514706525"
}
]
}
}
Loading