Skip to content

Commit

Permalink
Merge pull request #164 from Mavennet/eventsSample
Browse files Browse the repository at this point in the history
added simple root Event and fixed OGBillOfLading Generator
  • Loading branch information
mprorock authored Jun 29, 2021
2 parents fd05e51 + f038598 commit af88dad
Show file tree
Hide file tree
Showing 8 changed files with 987 additions and 2 deletions.
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": {
"$comment": "{\"term\": \"eventTime\", \"@id\": \"https://schema.org/DateTime#v2\"}",
"title": "Event Time",
"description": "The time when the event took place.",
"type": "string"
},
"products": {
"$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",
"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

0 comments on commit af88dad

Please sign in to comment.