GithubHelp home page GithubHelp logo

openepcis / openepcis-document-converter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 321 KB

Convert GS1 EPCIS events from JSON-LD to XML format and vice versa.

Home Page: https://openepcis.io

License: Apache License 2.0

Java 81.14% Makefile 2.10% XSLT 16.76%
epcis epcis-event epcis-standard epcis20 gs1 gs1-standard traceability cloud reactive reactive-streams

openepcis-document-converter's People

Contributors

devangchauhan avatar sboeckelmann avatar tnahddisttud avatar

Watchers

 avatar

openepcis-document-converter's Issues

Translation CURIEs (XML) to bare string notation (JSON/JSON/LD) for standard values

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

List with several identical user extension elements in XML: correct conversion into JSON/JSON-LD?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.