-
Notifications
You must be signed in to change notification settings - Fork 4
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
support for ignoring industry/repository specific fields #114
Merged
+309
−3
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b68b60f
incorporated support to ignore industry/repository specific fields
dakbhavesh 812da70
added support for ignoring fields from xml document
dakbhavesh 4916bb8
adjusted test files
dakbhavesh 843af30
adjusted test files to ensure unique hashes across the files
dakbhavesh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0 | ||
ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"@context": [ | ||
"https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld", | ||
{ | ||
"example": "https://ns.example.com/epcis/", | ||
"repository-x": "https://repository-x.example.com/" | ||
}, | ||
{ | ||
"rdfs": "http://www.w3.org/2000/01/rdf-schema#" | ||
} | ||
], | ||
"id": "https://id.example.org/document1", | ||
"type": "EPCISDocument", | ||
"schemaVersion": "2.0", | ||
"creationDate": "2005-07-11T11:30:47.0Z", | ||
"repository-x:ignoreFields": ["repository-x:hash", "example:captureID"], | ||
"epcisBody": { | ||
"eventList": [ | ||
{ | ||
"type": "ObjectEvent", | ||
"eventTime": "2019-10-21T14:45:00Z", | ||
"recordTime": "2023-06-02T07:03:16.073Z", | ||
"eventTimeZoneOffset": "+01:00", | ||
"eventID": "ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0", | ||
"epcList": [ | ||
"https://id.gs1.org/00/040123451111111127" | ||
], | ||
"action": "OBSERVE", | ||
"bizStep": "inspecting", | ||
"disposition": "in_progress", | ||
"readPoint": { | ||
"id": "https://id.gs1.org/414/4012345000245/254/1" | ||
}, | ||
"repository-x:hash": "ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0", | ||
"example:captureID": "cc90bbe4-7f3a-4abd-b150-d4371c72a64f" | ||
}, | ||
{ | ||
"type": "ObjectEvent", | ||
"eventTime": "2019-10-21T14:45:00Z", | ||
"recordTime": "2023-06-02T07:03:16.073Z", | ||
"eventTimeZoneOffset": "+01:00", | ||
"eventID": "ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0", | ||
"epcList": [ | ||
"https://id.gs1.org/00/040123451111111127" | ||
], | ||
"action": "OBSERVE", | ||
"bizStep": "inspecting", | ||
"disposition": "in_progress", | ||
"readPoint": { | ||
"id": "https://id.gs1.org/414/4012345000245/254/1" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eventType=ObjectEventeventTime=2019-10-21T14:45:00.000ZeventTimeZoneOffset=+01:00epcListepc=https://id.gs1.org/00/040123451111111127action=OBSERVEbizStep=https://ref.gs1.org/cbv/BizStep-inspectingdisposition=https://ref.gs1.org/cbv/Disp-in_progressreadPointid=https://id.gs1.org/414/4012345000245/254/1 | ||
eventType=ObjectEventeventTime=2019-10-21T14:45:00.000ZeventTimeZoneOffset=+01:00epcListepc=https://id.gs1.org/00/040123451111111127action=OBSERVEbizStep=https://ref.gs1.org/cbv/BizStep-inspectingdisposition=https://ref.gs1.org/cbv/Disp-in_progressreadPointid=https://id.gs1.org/414/4012345000245/254/1 |
2 changes: 2 additions & 0 deletions
2
tests/examples/epcisQueryDocHavingEventWithIgnoreFields.hashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0 | ||
ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0 |
57 changes: 57 additions & 0 deletions
57
tests/examples/epcisQueryDocHavingEventWithIgnoreFields.jsonld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"@context": [ | ||
"https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld", | ||
{ | ||
"example": "https://ns.example.com/epcis/", | ||
"repository-x": "https://repository-x.example.com/" | ||
} | ||
], | ||
"type": "EPCISQueryDocument", | ||
"schemaVersion": "2.0", | ||
"creationDate": "2005-07-11T11:30:47.0Z", | ||
"epcisBody": { | ||
"queryResults": { | ||
"subscriptionID": "32d2aec1-a6d2-46d9-900a-24124288cce1", | ||
"queryName": "SimpleEventQuery", | ||
"repository-x:ignoreFields": ["repository-x:hash", "example:captureID"], | ||
"resultsBody": { | ||
"eventList": [ | ||
{ | ||
"type": "ObjectEvent", | ||
"eventTime": "2019-10-21T14:45:00Z", | ||
"recordTime": "2023-06-02T07:03:16.073Z", | ||
"eventTimeZoneOffset": "+01:00", | ||
"eventID": "ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0", | ||
"epcList": [ | ||
"https://id.gs1.org/00/040123451111111127" | ||
], | ||
"action": "OBSERVE", | ||
"bizStep": "inspecting", | ||
"disposition": "in_progress", | ||
"readPoint": { | ||
"id": "https://id.gs1.org/414/4012345000245/254/1" | ||
}, | ||
"repository-x:hash": "ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0", | ||
"example:captureID": "cc90bbe4-7f3a-4abd-b150-d4371c72a64f" | ||
}, | ||
{ | ||
"type": "ObjectEvent", | ||
"eventTime": "2019-10-21T14:45:00Z", | ||
"recordTime": "2023-06-02T07:03:16.073Z", | ||
"eventTimeZoneOffset": "+01:00", | ||
"eventID": "ni:///sha-256;b3d481c5590757ab8361a6cb0e924820feb3b61eb568e7d7703f21a96f76f51d?ver=CBV2.0", | ||
"epcList": [ | ||
"https://id.gs1.org/00/040123451111111127" | ||
], | ||
"action": "OBSERVE", | ||
"bizStep": "inspecting", | ||
"disposition": "in_progress", | ||
"readPoint": { | ||
"id": "https://id.gs1.org/414/4012345000245/254/1" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/examples/epcisQueryDocHavingEventWithIgnoreFields.prehashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eventType=ObjectEventeventTime=2019-10-21T14:45:00.000ZeventTimeZoneOffset=+01:00epcListepc=https://id.gs1.org/00/040123451111111127action=OBSERVEbizStep=https://ref.gs1.org/cbv/BizStep-inspectingdisposition=https://ref.gs1.org/cbv/Disp-in_progressreadPointid=https://id.gs1.org/414/4012345000245/254/1 | ||
eventType=ObjectEventeventTime=2019-10-21T14:45:00.000ZeventTimeZoneOffset=+01:00epcListepc=https://id.gs1.org/00/040123451111111127action=OBSERVEbizStep=https://ref.gs1.org/cbv/BizStep-inspectingdisposition=https://ref.gs1.org/cbv/Disp-in_progressreadPointid=https://id.gs1.org/414/4012345000245/254/1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ni:///sha-256;2e3080ec5bfad98586d73f1943fae80e201613c1b2c0f084b3b8cd5976aaea5c?ver=CBV2.0 | ||
ni:///sha-256;bfcf5b87dd396d4f7b266e33d4a969dc5250344ed0e47e85ce8e26d1adadad11?ver=CBV2.0 |
2 changes: 2 additions & 0 deletions
2
tests/examples/epcisXmlDocHavingEventWithIgnoreFields.prehashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eventType=ObjectEventeventTime=2024-06-08T08:58:56.591ZeventTimeZoneOffset=+02:00quantityListquantityElementepcClass=https://id.gs1.org/01/04054739999612/10/2015-03-30aquantity=150uom=KGMaction=ADDbizStep=https://ref.gs1.org/cbv/BizStep-commissioningreadPointid=https://id.gs1.org/414/4054738000050{https://ns.example.com/epcis/}testField4=ABCD | ||
eventType=ObjectEventeventTime=2024-06-08T08:58:56.591ZeventTimeZoneOffset=+02:00quantityListquantityElementepcClass=https://id.gs1.org/01/04054739999612/10/2015-03-30aquantity=150uom=KGMaction=ADDbizStep=https://ref.gs1.org/cbv/BizStep-commissioningreadPointid=https://id.gs1.org/414/4054738000050{https://ns.example.com/epcis/}testField3=PQRS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<epcis:EPCISDocument xmlns:epcis="urn:epcglobal:epcis:xsd:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:cbv="https://ref.gs1.org/cbv/" | ||
schemaVersion="2.0" | ||
creationDate="2024-06-08T12:00:00.000+01:00" | ||
xsi:schemaLocation="urn:epcglobal:epcis:xsd:2 EPCglobal-epcis-2_0.xsd" | ||
xmlns:repository-x="https://repository-x.example.com/" | ||
xmlns:example="https://ns.example.com/epcis/"> | ||
<repository-x:ignoreFields> | ||
<example:testField1/> | ||
<example:testField2/> | ||
</repository-x:ignoreFields> | ||
<EPCISBody> | ||
<EventList> | ||
<ObjectEvent> | ||
<eventTime>2024-06-08T10:58:56.591+02:00</eventTime> | ||
<recordTime>2024-06-08T15:38:32.052+02:00</recordTime> | ||
<eventTimeZoneOffset>+02:00</eventTimeZoneOffset> | ||
<epcList/> | ||
<action>ADD</action> | ||
<bizStep>urn:epcglobal:cbv:bizstep:commissioning</bizStep> | ||
<readPoint> | ||
<id>urn:epc:id:sgln:4054738.00005.0</id> | ||
</readPoint> | ||
<extension> | ||
<quantityList> | ||
<quantityElement> | ||
<epcClass>urn:epc:class:lgtin:4054739.099961.2015-03-30a</epcClass> | ||
<quantity>150</quantity> | ||
<uom>KGM</uom> | ||
</quantityElement> | ||
</quantityList> | ||
</extension> | ||
<example:testField1>1234</example:testField1> | ||
<example:testField4>ABCD</example:testField4> | ||
</ObjectEvent> | ||
<ObjectEvent> | ||
<eventTime>2024-06-08T10:58:56.591+02:00</eventTime> | ||
<recordTime>2024-06-08T15:38:32.052+02:00</recordTime> | ||
<eventTimeZoneOffset>+02:00</eventTimeZoneOffset> | ||
<epcList/> | ||
<action>ADD</action> | ||
<bizStep>urn:epcglobal:cbv:bizstep:commissioning</bizStep> | ||
<readPoint> | ||
<id>urn:epc:id:sgln:4054738.00005.0</id> | ||
</readPoint> | ||
<extension> | ||
<quantityList> | ||
<quantityElement> | ||
<epcClass>urn:epc:class:lgtin:4054739.099961.2015-03-30a</epcClass> | ||
<quantity>150</quantity> | ||
<uom>KGM</uom> | ||
</quantityElement> | ||
</quantityList> | ||
</extension> | ||
<example:testField2>1234</example:testField2> | ||
<example:testField3>PQRS</example:testField3> | ||
</ObjectEvent> | ||
</EventList> | ||
</EPCISBody> | ||
</epcis:EPCISDocument> |
2 changes: 2 additions & 0 deletions
2
tests/examples/epcisXmlQueryDocHavingEventWithIgnoreFields.hashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ni:///sha-256;573a43267f95d2ddbe7e7487ad3ffb89e78ee8c72a296b868d9e5baeb8baef34?ver=CBV2.0 | ||
ni:///sha-256;1e6c7bbfc2d3f744e99af09ad8216505b72f0ced383e391f92ab92674dc906c4?ver=CBV2.0 |
3 changes: 3 additions & 0 deletions
3
tests/examples/epcisXmlQueryDocHavingEventWithIgnoreFields.prehashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
eventType=ObjectEventeventTime=2024-06-08T08:58:56.591ZeventTimeZoneOffset=+02:00quantityListquantityElementepcClass=https://id.gs1.org/01/04054739999612/10/2015-03-30aquantity=150uom=KGMaction=ADDbizStep=https://ref.gs1.org/cbv/BizStep-commissioningreadPointid=https://id.gs1.org/414/4054738000050{https://ns.example.com/epcis/}testField4=ABC | ||
eventType=ObjectEventeventTime=2024-06-08T08:58:56.591ZeventTimeZoneOffset=+02:00quantityListquantityElementepcClass=https://id.gs1.org/01/04054739999612/10/2015-03-30aquantity=150uom=KGMaction=ADDbizStep=https://ref.gs1.org/cbv/BizStep-commissioningreadPointid=https://id.gs1.org/414/4054738000050{https://ns.example.com/epcis/}testField3=XYZ | ||
|
62 changes: 62 additions & 0 deletions
62
tests/examples/epcisXmlQueryDocHavingEventWithIgnoreFields.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<epcisq:EPCISQueryDocument xmlns:epcisq="urn:epcglobal:epcis-query:xsd:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:cbvmda="urn:epcglobal:cbv:mda" | ||
xmlns:sbdh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" | ||
schemaVersion="2.0" | ||
creationDate="2024-06-08T11:30:47.0Z" | ||
xmlns:repository-x="https://repository-x.example.com/" | ||
xmlns:example="https://ns.example.com/epcis/"> | ||
<repository-x:ignoreFields> | ||
<example:testField1/> | ||
<example:testField2/> | ||
</repository-x:ignoreFields> | ||
<queryName>SimpleEventQuery</queryName> | ||
<resultsBody> | ||
<EventList> | ||
<ObjectEvent> | ||
<eventTime>2024-06-08T10:58:56.591+02:00</eventTime> | ||
<recordTime>2024-06-08T15:38:32.052+02:00</recordTime> | ||
<eventTimeZoneOffset>+02:00</eventTimeZoneOffset> | ||
<epcList/> | ||
<action>ADD</action> | ||
<bizStep>urn:epcglobal:cbv:bizstep:commissioning</bizStep> | ||
<readPoint> | ||
<id>urn:epc:id:sgln:4054738.00005.0</id> | ||
</readPoint> | ||
<extension> | ||
<quantityList> | ||
<quantityElement> | ||
<epcClass>urn:epc:class:lgtin:4054739.099961.2015-03-30a</epcClass> | ||
<quantity>150</quantity> | ||
<uom>KGM</uom> | ||
</quantityElement> | ||
</quantityList> | ||
</extension> | ||
<example:testField1>123</example:testField1> | ||
<example:testField4>ABC</example:testField4> | ||
</ObjectEvent> | ||
<ObjectEvent> | ||
<eventTime>2024-06-08T10:58:56.591+02:00</eventTime> | ||
<recordTime>2024-06-08T15:38:32.052+02:00</recordTime> | ||
<eventTimeZoneOffset>+02:00</eventTimeZoneOffset> | ||
<epcList/> | ||
<action>ADD</action> | ||
<bizStep>urn:epcglobal:cbv:bizstep:commissioning</bizStep> | ||
<readPoint> | ||
<id>urn:epc:id:sgln:4054738.00005.0</id> | ||
</readPoint> | ||
<extension> | ||
<quantityList> | ||
<quantityElement> | ||
<epcClass>urn:epc:class:lgtin:4054739.099961.2015-03-30a</epcClass> | ||
<quantity>150</quantity> | ||
<uom>KGM</uom> | ||
</quantityElement> | ||
</quantityList> | ||
</extension> | ||
<example:testField2>123</example:testField2> | ||
<example:testField3>XYZ</example:testField3> | ||
</ObjectEvent> | ||
</EventList> | ||
</resultsBody> | ||
</epcisq:EPCISQueryDocument> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering Sven's comment:
#109 (comment)
I think it would be a really good idea to add the ignored fields into the NI.
In the current PR state, you are not able to check if an event (only the event object) equals its hash (NI) since neither contains the list of fields to be excluded from the hash.