From XML Schema to JSON Schema - Comparison …
Ulm University | 89069 Ulm | Germany
Faculty of Engineering and Computer Science Institute of Software Engineering and Compiler Construction
From XML Schema to JSON Schema Comparison and Translation with Constraint Handling Rules
Bachelor Thesis at the University of Ulm
Submitted by: Falco Nogatz falco.nogatz@uni-ulm.de
Reviewer: Prof. Dr. Thom Fr?hwirth
2013
Version December 10, 2013
c 2013 Falco Nogatz This work is licensed under the Creative Commons. Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA. Satz: PDF-LATEX 2
Abstract
This thesis identifies similar semantics in the two schema definition languages XML Schema and JSON Schema to build a dictionary which covers typical use cases to automatically transform first to the latter. As the range of functions of both XML Schema and JSON Schema are not identical, concrete transformation rules to reproduce similar behavior of data constraints are discussed and implemented by use of the logic programming language Constraint Handling Rules. As a result, a Prolog library xsd2json is created which provides tools to translate complex XML Schema documents into their equivalent JSON Schema documents.
iii
Contents
1. Introduction
1
1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2. Scope of this Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3. Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4. Road Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Technologies
5
2.1. XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2. XML Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3. JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4. JSON Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.5. Prolog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.6. Constraint Handling Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3. General Translation Process
17
3.1. Read in XML Schema into Prolog . . . . . . . . . . . . . . . . . . . . . . . 19
3.2. XML Flattening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.3. Setting Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.4. Fragment Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.5. Wrap JSON Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.6. Clean up and JSON Output . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4. Translation Rules
35
4.1. XSD Primitive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
v
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- json fpml a discussion document
- edward dorr director community integration
- dealing with json data in oracle dos and don ts
- xml and json westmont college
- json schema vs json object
- from xml schema to json schema comparison
- understanding json schema
- experiences with json and xml
- comparison of json and xml data formats
Related searches
- xsd to json schema converter online
- xsd to json schema online
- convert xml schema to json schema
- json to json schema converter online
- json to json schema tool
- xml schema to json schema
- json schema to json generator
- json schema vs xml schema
- json schema to json data
- xml files to json files python
- json to json schema generator
- convert json schema to json ld