EKanban Example

From Wiki

Jump to: navigation, search

Description

The eKanban SyncShipmentSchedule Semantic Reconciliation example is a small demonstration of the message content transformation that happens between two businesses applications whose message interfaces are based on different XML schemas standards. The electronic Kanban (eKanban) is a business process that regulates the flow of goods from the supplier to match actual usage by the customer. In eKanban, “inventory visibility” applications support manufacturers and their suppliers, and communicate with each other by XML message instances to reach other suppliers.

eKanban SyncShipmentSchedule message exchanges flow: The proprietary version of the SyncShipmentSchedule business message used by the GM manufacturer’s application has to be sent to the inventory visibility application (“IV”), which is developed to receive the standard SyncShipmentSchedule BOD messages only. Therefore, the message content transformation from GM’s SyncShipmentSchedule to BOD’s SyncShipmentSchedule message is needed. Both SyncShipmentSchedule message schemas are specified in XML Schema, and there are several mismatches between them. E.g., naming mismatches where message elements have the same content but different names (gmSyncShipmentSchedule vs. SyncShipmentSchedule) or structural path mismatches where different sequences of message elements and sub-elements (i.e., paths) exist from the root element to the element where content is captured (gmSyncShipmentSchedule.documentId vs. SyncShipmentSchedule.DataArea. ShipmentSchedule.ShipmentScheduleHeader.DocumentId). To reconcile these mismatches and to transform message content we use a eKanban Reference Ontology and Message Metamodel–based semantic reconciliation.

Semantic reconciliation steps: Several steps are needed to be accomplished in order to enable GM-to-IV message exchange by using the Message 
Metamodel-based semantic reconciliation to transform message content from GM’s SyncShipmentSchedule to the SyncShipmentSchedule BOD;
1. transformation of the GM and BOD SyncShipmentSchedule XML schemas to the GM and BOD OWL message-schema models, respectively 2. creation of the forward reconciliation rules that transform message content from a GM OWL message-instance model (that correspond to the GM XML SyncShipmentSchedule message) to the eKanban reference ontology instance. For this purpose, we use JENA rule language 3. creation of the backward reconciliation rules that transform message content from the eKanban reference ontology instance to the BOD OWL message- instance model (that correspond to the BOD XML SyncShipmentSchedule message). For this purpose, we use JENA rule language. 4. Semantic reconciliation execution that involves; 4.1 transformation of GM’s SyncShipmentSchedule XML message to corresponding GM OWL message-instance model 4.2 forward reconciliation rules execution on the GM OWL message-instance model. This step produces set of reference ontology concept instances populated with the GM SyncShipmentSchedule message content. 4.3 backward reconciliation rules execution on the reference ontology instance. This step produces of the BOD OWL message-instance model populated with the GM SyncShipmentSchedule message content (which is however transformed to conform to the BOD SyncShipmentSchedule message definition) 4.4 and finally, transformation of the BOD OWL message-instance model to the BOD SyncShipmentSchedule XML message-schema conformant message.


If you want to examine or to try this example practically..

If you want to examine the files or to try this example practically, download the zip archive DemoExample.zip (here) and unzip it at your local C: disk. When Demo.zip is unzipped, the folder structure looks as shown in the next Figure.



  • The /eKanExample/BOD/xml/ folder contains the BOD SyncShipmentSchedule XML schema file (SyncShipmentSchedule-EKanbanPOC.xsd). SyncShipmentSchedule-EKanbanPOC.xsd imports other XML shemas files and they are located also in the eKabExample/BOD/xml folder.
  • The /eKanExample/BOD/mmm/ folder contains the BOD OWL message-schema model file (SyncShipmentSchedule-EKanbanPOC.owl).
  • The /eKanExample/GM/xml/ folder contains the GM SyncShipmentSchedule XML schema file (gmSyncShipmentSchedule.xsd).
  • The /eKanExample/GM/mmm/ folder contains the GM OWL message-schema model file (gmSyncShipmentSchedule.owl).
  • The /eKanExample/ReferenceOntology/ folder contains eKanban OWL Reference Ontology file (eKanban.owl).
  • The /eKanExample/MessageMetamodelOntology/ folder contains Message Metamodel OWL Ontology file (MMMOntology.owl).
  • The /eKanExample/Rules/ contains some examples of forward and backward rules. These are located in two files; forward.txt and backward.txt
  • The /eKanExample/ioengine/ folder contains GM SyncShipmentSchedule XML message file (gmSyncShipmentSchedule.xml) that is an input to the runtime semantic reconciliation. The files produced inside the semantic reconciliation engine are 1) gmSyncShipmentScheduleInstance.owl, which is a OWL message-instance model that corresponds to the GM SyncShipmentSchedule XML message; 2) refOntologyInstance.owl, which is a reference ontology instance gotten after the forward rules (/eKanExample/Rules/ forward.txt) are executed.; 3) backwardReconciliationOutput.owl file, which is a OWL message-instance model that corresponds to the BOD SyncShipmentSchedule XML message. The output of the semantic reconciliation is a BOD SyncShipmentSchedule XML message file (bodSyncShipmentSchedule.xml).


To try this example practically we provide Java source files (download) and necessary jar libraries (download). One should create Java project using his/her favorite JAVA IDE (we use Eclipse 3.3.0), then incorporate these source files, and put jar libraries on the build path (java classpath). Source files are organized in the /src/examples/ekanban/ folder.


The Java classes you need to try the example are;

1. examples.ekanban.MessageSchemaModelTransformTest.java can be used to reproduce  the BOD OWL message-schema model file (/eKanExample/BOD/mm
/SyncShipmentSchedule-EKanbanPOC.owl) and GM OWL message-schema model file (/eKanExample/BOD/mmm/gmSyncShipmentSchedule.owl). 
- generateBODMSM() method generates corresponding OWL message-schema model for the BOD SyncShipmentSchedule XML schema - generateGMMSM() method generates corresponding OWL message-schema model for the GM SyncShipmentSchedule XML schema
2. examples.ekanban.ReconciliationTest.java can be used if one want to simulate the semantic reconciliation execution. 
- reconcileForward() method demonstrates the transformation of message content from the GM XML message instance into the content of reference ontology instance. It takes gmSyncShipmentSchedule.xml file, creates gmSyncShipmentScheduleInstance.owl, executes forward reconciliation by applying the JENA rules stored in forward.txt on the gmSyncShipmentScheduleInstance.owl document. Finally, this method creates refOntologyInstance.owl file which is a eKanban Reference Ontology instance
- reconcileBackward() method demonstrates transformation of the message content from the reference ontology instance to a BOD XML message instance. It takes the JENA rules stored in the backward.txt rules and applies them on the refOntologyInstance.owl document; this produces BOD OWL message- instance model (backwardReconciliationOutput.owl file). Finally, from the backwardReconciliationOutput.owl file, the BOD SyncShipmentSchedule XML message file is produced(bodSyncShipmentSchedule.xml)
- main() method invokes reconcileForward() and reconcileBackward() methods, and thus, demonstrates the message content transformation from GM’s SyncShipmentSchedule to BOD’s SyncShipmentSchedule XML message.

If one wants to create more semantic reconciliation rules (either forward or backward ones) we provide Java classes that easy the task of defining the rule head or rule body of JENA expressions;

3. examples.ekanban.MessageSPathGenerator 
- provides methods for generation of so-called 'Spaths' expression for a given message path for JENA rule body of forward reconciliation rules and for JENA rule head of backward reconciliation rules.
4. examples.ekanban.OntologyTripleGenerator
- provides methods for generation of so-called 'OntPaths' expression for a given ontology path for JENA rule head of the forward reconciliation rules and for JENA rule body of the backward reconciliation rules.

We also provide several custom JENA functions (Split, Merge, Map, SetValue, and Convert).

Don’t hesitate to ask if any further help is needed.

Personal tools