From XML Schema to JSON Schema - Comparison and ...
Ulm University | 89069 Ulm | Germany
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 Frhwirth
2013
Faculty of
Engineering and
Computer Science
Institute of Software
Engineering and Compiler
Construction
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
- from xml schema to json schema comparison and
- sas json procedure tip sheet
- 296 2013 efficient extraction of json information in sas
- flat file schema developer s guide software ag
- json as a native tcl value
- declaring json string swift
- lab parse different data types with python
- setting up a database in a flask application
- smart connected digital platform api overview
Related searches
- xsd to json schema converter online
- xsd to json schema online
- create json schema from json
- convert xml schema to json schema
- create json schema from sample
- json to json schema converter online
- json to json schema tool
- xml schema to json schema
- json schema to json generator
- generate json schema from json
- json schema vs xml schema
- json schema to json data