openepcis / openepcis-document-converter Goto Github PK
View Code? Open in Web Editor NEWConvert GS1 EPCIS events from JSON-LD to XML format and vice versa.
Home Page: https://openepcis.io
License: Apache License 2.0
Convert GS1 EPCIS events from JSON-LD to XML format and vice versa.
Home Page: https://openepcis.io
License: Apache License 2.0
Dear @sboeckelmann ,
Im using your (great) web application, I just noticed that if an XML document makes use of CURIEs in e.g. the bizStep field, the same value is taken over in the JSON/JSON LD document as well. At the same time, a JSON/JSON-LD doc, IMHO, should only contain the corresponding bare string notation for all CBV standard values. Interestingly, it works for type
in the sensorReport field: in this case, the tool correctly translates the value from 'gs1:Dimensionless' to 'Dimensionless'. But e.g. for 'cbv:Disp-in_progress', it leaves the value as is.
AFAIK, we never provided message examples for this case, so I am happy to provide the following exemplary EPCIS XML Doc:
<?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:gs1="https://gs1.org/voc/" xmlns:cbv="https://ref.gs1.org/cbv/" xmlns:ext1="https://ns.ext.de/epcis/" schemaVersion="2.0" creationDate="2023-01-11T12:00:00.000+01:00" xsi:schemaLocation="urn:epcglobal:epcis:xsd:2 EPCglobal-epcis-2_0.xsd">
<EPCISBody>
<EventList>
<ObjectEvent>
<eventTime>2023-01-11T12:00:00+01:00</eventTime>
<eventTimeZoneOffset>+01:00</eventTimeZoneOffset>
<certificationInfo>https://accreditation-council.example.org/certificate/ABC12345</certificationInfo>
<epcList>
<epc>https://id.gs1.de/01/04012345999990/21/XYZ-1234</epc>
</epcList>
<action>OBSERVE</action>
<bizStep>cbv:BizStep-receiving</bizStep>
<disposition>cbv:Disp-in_progress</disposition>
<readPoint>
<id>https://id.gs1.de/414/4012345000115</id>
</readPoint>
<sensorElementList>
<sensorElement>
<sensorMetadata ext1:someFurtherMetadata="metadataText" time="2023-01-11T11:05:00Z" bizRules="https://id.example.com/253/4012345000054987"/>
<sensorReport exception="gs1:ALARM_CONDITION" coordinateReferenceSystem="http://www.opengis.net/def/crs/EPSG/0/27700" ext1:someFurtherReportData="reportText" type="gs1:Dimensionless"/>
</sensorElement>
</sensorElementList>
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
Would you agree that it make ssense to adjust this behaviour?
Kind regards,
@RalphTro
Json result is not proper when converting xml file ( with EPCISHeader )
Dear @sboeckelmann and colleagues,
I just came across the following observation while using your (great) tool which I want to discuss with you:
Let us assume we have the following user extension element in XML:
<example:userListElement>
<entry>1</entry>
<entry>2</entry>
<entry>3</entry>
</example:userListElement>
Right now, the tool converts it into the following JSON structure:
"example:userListElement": {
"entry": [
"1",
"2",
"3"
]
},
Are you sure that this is really the correct/desired output? I am especially struggling with how "entry" becomes a list name.
My expectation was that the tool would convert it into sth. like this:
(a)
{"example:userListElement": [
{"entry": "1"},
{"entry": "2"},
{"entry": "3"}
]
}
or
(b)
{"example:userListElement": [
"1",
"2",
"3"
]
}
What is your opinion on this matter?
FYC, I enclosed the input XML file which I was using.
XMLWithRepeatableUserExtensionElements.xml.zip
Many thanks in advance for sharing your thoughts.
Kind regards,
Ralph
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.