Sei sulla pagina 1di 31

XML SCHEMA LANGUAGES

AS A TECHNICAL FUNDAMENTAL OF
FORMALISED DESCRIPTION OF MAPS
OTAKAR CERBA

Geomatics Section
Department of Mathematics
Faculty of Applied Sciences
University of West Bohemia in Pilsen
Czech Republic

The Future of Maps and the Internet, November, 13-15, 2009 Viña Del Mar, Valparaiso, Chile
1
Introduction

• Ing. et Mgr. Otakar Cerba


• Geomatics section on University of West Bohemia in Pilsen
since 1995
• Member of Czech cartographic society
• Application of XML technologies (XML schema languages,
XSLT) and data modeling techniques to digital cartography
• Projects: VisualHealth, Humboldt, Plan4all, SDI-EDU

2
Objectives
• Formalized description of map
• XML & XML schema languages
• RELAX NG language & its possibilities
• Formalized description of map through RELAX NG
• Future steps
• Conclusion
namespace dc = "http://purl.org/dc/elements/1.1/" start = Atlas_element |
MapSet_element | Map_element Atlas_element = element Atlas {MapSet_or_Atlas}
MapSet_element = element MapSet {MapSet_or_Atlas} MapSet_or_Atlas =
MapSet_element* & ap_element* & Metadata_DCMI Map_element = element Map {
Technique_element+ & Metadata_DCMI} # Group of metadata elements common to all
root elements Metadata_DCMI = element dc:title {text} & element dc:creator
{text} & element dc:description {text}? Technique_element = element Technique {
attribute name "Choropleth"} &element SourceData {attribute uri {xsd:anyURI}
& attribute geometry {text} & element Parameter {text}* } & element Border
{attribute width {xsd:decimal}+ & attribute colour {text}+ & attribute structure
{text}+ }* & element Inside { attribute fillColour {text} | attribute fillURI
{xsd:anyURI} } & element Classification { attribute name {"Constant" |
"Qunatilies" | "Standard_deviation"}+ & attribute classesNumber {xsd:decimal}+}
3
Cartography vs. Information technologies

’Cartography is an information transfer


Information
Cartography process
technologies that is centred aboutCartography
a spatial
database which can be considered, in
itself, a multifaceted model of geographic
reality. Such a spatial database then
serves as the central core of an entire
sequence of cartographic processes,
receiving various data inputs and
dispensing various types of information
products.‘ (Guptill & Starr 1984).

Information Web environment Web environment


technologies
Services Services

Data sharing Data sharing

Automated Automated
processing processing

4
Situation in cartography
Data Format Specification
model
Specification Platform
Platform

Platform Standard

Data Format
model
Specification
Specification
Data
Standard model
Platform
Format

Specification
Format
Data
model
Standard Cartographer who wants to
Platform share maps, communicate,
through Internet and use WPS Standard
Standard

Data
model Standard Specification Format Data
model
5
Way from the labyrinth

Exploitation of “cartographic” benefits of the Internet


Detailed and standardized
description of data models of all levels
and data formats through exchange
Removing of problems related to data
models, data formats, platforms, format based on a platform
specifications, standards... independent language

IT IS IMPOSSIBLE!!!

To eliminate consequences of heterogeneities

HOW?

XML

6
XML? What is it?

• Markup language or 1. XML is a protocol for


metalanguage containing and managing
• XML marks the meaning of information.
particular parts of 2. XML is a family of
documents, but does not technologies that can do
specify their design everything from formatting
• XML describes data and documents to filtering data.
their structure 3. XML is a philosophy for
• XML is the base of information handling that
semantic data seeks maximum usefulness
and flexibility for data by
refining it to its purest and
most structured form.

7
XML? Why do we need it?

Self-description

XML
Independence

Freedom

<Atlas atlasTitle Simplicity


=”Name of Atlas”>
<Map mapTitle Clarity
=”Map01”/>
</Atlas> Expansion

Relations

8
XML schema languages? Why?
We have XML...
<Map>
• XML can have an effect of
bigger chaos.
• XML is not a concrete data
format. It is a set of rules for
building markup languages.
<map>
• Everybody can create and <MyMap>
use own names of elements
<My_Map>
and attributes
• No interoperability

Where is
? the promised interoperability?
The freedom to define tag names
and attributes has to be constrained

9
XML schema languages enable to...

• ...define and describe any subset of XML – a formal


definition of a new markup language or format (e.g.
elements, attributes, entities, their limits and restrictions)
• ...be used as filters or firewalls protecting computers
against heterogeneities of XML formats and languages
• ...be processed by special software called validators being
able to control the structure of data file
• ...eliminate the heterogeneities related to different data
structures, formats, models etc.
• ...create and work with PSVI (Post-Schema Validation
Infoset)
• ...generate documentation materials of XML-based formats

10
XML schema languages enable unification, but...

XML schema languages

DTD W3C XML Schema RELAX NG

XML-Data RELAX
XML-Data-Reduced Xduce
Document Content Description TREX
Schema for Object-Oriented XML Schematron
Document Definition Markup Language Examplotron

11
XML schema languages triumvirate

Property DTD W3C XML RELAX NG


Schema

Author W3C W3C OASIS RELAX NG TC & ISO


DSDL WG

PSVI yes yes no


Structure yes yes yes
Data types yes (weak) yes no (pluggable)
Integrity local with local yes
rules restrictions

Other rules no no no

Vendor excellent potentially improving


support excellent

12
Which format is the best?
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Map">
<xs:complexType>
<xs:sequence>
<xs:element ref="Title"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Title" type="xs:string"/>
</xs:schema>

<!ELEMENT Map (Title)> <?xml version="1.0" encoding="UTF-8"?> element Map {


<!ELEMENT Title (#PCDATA)> <element name="Map" element Title {text}
xmlns="http://relaxng.org/ns/structure/1.0"> }
<element name="Title">
<text/>
</element>
</element>

XML schema language XML format


DTD SVG 1.0, SVG 1.1, SVG Mobile Profiles, GML 1.0, SLD 0.71, X3D 3.0
W3C XML Schema KML 2.2, GML 2.0-3.2.1, LandXML 1.0-1.2, DiaML, SLD 0.72-1.1.0, X3D 3.0
RELAX NG SVG Tiny 1.2
13
Relax with RELAX NG

• RELAX NG = RELAX + TREX + Xduce


• ISO standard (ISO/IEC FDIS 19757-2 Document Schema
Definition Language (DSDL) -- Part 2: Regular-grammar-
based validation – RELAX NG)
• Two forms of syntax – XML-based and compact
• Support of XML Namespaces
• Re-using data types defined in W3C XML schema
• Relationship to Schematron
• Transformation to other XML schema languages (DTD,
W3C XML Schema, both syntax form of RELAX NG)
through software Trang

14
RELAX NG patterns

• Elements, attributes, comments


• Mandatory and optional elements and attributes
• Sequence (order) of parts of data – forced, free
• Multiple occurrence of elements
• Choices of elements and attributes
• Context – parts of data dependent on other values of data
• Data types (in-built, W3C XML Schema)
• Enumeration data type
• Condition of data values

15
RELAX is not all-powerful. Try DSDL

• The complete validation • Regular-grammars (RELAX


process is more complex NG focuses on this part)
than control of grammar • Rules
only. • XML Namespaces
• Users need a control of • Data Types
different namespaces,
characters, data types, • Path-based integrity
integrity etc. constraints
• DSDL (ISO/IEC 19757) • Character Repertoire
represents a framework • Document Schema
and a set of tools used for Renaming
check of quality and • Interconnection to DTD
correctness of XML data

16
Advantages of XML-based description

• Based on the schemes it will be possible to create software


uniformly processing described data
• Data can be controlled using validators
• XML schema languages bring more comfort to the editors
• In the case of choice of semantically understandable
names the description of maps will easy to read for people
• Anyone who has once learned to describe the map with a
specific subset of the XML language, will be able to carry
out his work quickly and efficiently in other similar cases
• Only a formalized description will link with other standards
• Software working with formalized description allows to
generate not only a map sheet and its features, but also
compositional elements, GUI, metadata
17
What can be described?
Title

Legend

Menu (GUI)

Cartographic technique

Visual variables
Metadata
Symbolisation
Source data

Output format
Classing

Scale

18
Example: Structure of maps

Atlas

dc:title

Metadata
MapSet dc:creator
(DCMI)

dc:description

Map

Root elements Top-down modeling process

19
Example: Structure of maps

namespace dc = "http://purl.org/dc/elements/1.1/"

start = Atlas_element | MapSet_element | Map_element

Atlas_element = element Atlas {MapSet_or_Atlas}

MapSet_element = element MapSet {MapSet_or_Atlas}

MapSet_or_Atlas =
MapSet_element* &
Map_element* &
Metadata_DCMI

Map_element = element Map {


Metadata_DCMI}

# Group of metadata elements common to all root elements


Metadata_DCMI =
element dc:title {text},
element dc:creator {text}+,
element dc:description {text}?
20
Example: Cartographic technique
Source data

Cartographic
techniques
modeling
Mid-level modeling process

Syntactic
types of Visual
cartographic variables
method

Decomposition Assignment of
of cartographic properties of
symbols symbols

Relatively
Absolutely
(parametrization)

21
Example: Choropleth maps

Source data

• Factors influencing
selection of concrete
visual variables: Choropleth
maps
• They must be
– suitable for Areals Borders
quantitative data
– describable with
SVG Type of fill
(colour, pattern)
Width, colour,
structure

Relatively Absolutely

22
Process of map generating used in VisualHealth
project and Atlas of International Relationships

Geodata Description
of the map
Transformation Thematic map
processor presented
in the browser
Visualisation
rules

GML, JML... XML


(RELAX NG)
Saxon
(or internal p.) SVG, KML...

XSLT 2.0

23
Combination of choropleth map and pie charts

<Map title="2000">
<Method name="Choropleth" colors="Quant1" classing="Quantils"
classes="6" border-multiple="1">
<Data file="Gen_Data/orp_gen.gml"/>
<Param legendTitle="Obyvatelstvo">ogr:OB01</Param>
</Method>
<Method name="PieChart" legendTitle="Počet..."
parameter="ogr:prevalence_muzi">
<Data file="Data/diabetes_lecba_muzi_2000.gml"/>
<Param legendTitle="Léčba dietou">ogr:dieta</Param>
<Param legendTitle="Kombinovaná léčba">ogr:kombi</Param>
<Param legendTitle="Léčba PAD">ogr:pda</Param>
<Param legendTitle="Léčba inzulínem">ogr:inzulin</Param>
</Method>
</Map>

24
Examples of visualization of thematic map
described by XML-based format

25
Future steps – cartographic view

• Interconnection of schemes of the two above mentioned


projects and other scheme fragments and patterns
• Detailed list of similar solutions – schemes, data models,
classification system, ontologies... (e.g. Symbology
Encoding Implementation Specification or DiaML
• Terminology questions – it is required to establish a robust
system of cartographic terminology based on a thesaurus
and domain ontologies
• Control of cartographic requirements
• Many previous questions (analysis of the issues of
conceptual maps of cartographic ontologies etc.) are
mentioned in ICA Research Agenda

26
Future steps – technical view

• Application of contexts based on the concrete values of


elements or attributes
• Strict data types declaration – changing the general data
type text to a specific data type taken from the W3C XML
Schema or regular expressions
• The implementation of inheritance rules, which allows
sharing properties among the nested elements
• Modularization of long and complicated scheme – structure
of maps, groups of maps or atlases, cartographic
techniques and data types

27
Conclusion – advantages to web cartography

• Validation – automatically checking syntax of a document


• Interoperability – communication and exchange of
information not only in cartographic domains
• Accessibility of cartographic products – elimination the
impossibility of use of applications

28
Conclusion - relations

ICA Research Next generation


Agenda of Web (2.0...)

Formalized
XML Expert
technologies
description systems
of maps

Spatial data
Web services
infrastructure

29
Conclusion

• Increase in abstraction and formalization → higher level of


automated processes in cartography
• Formalized language to describe the map →
– positive changes in quality of services
– wider use of other types of services providing data
and allowing for processing
• But...
Cartographers’ action cannot be completely replaced with
automated processes → the formal description of the map
cannot constitute a final solution for creating maps but only
one of the tools to support creative activities of cartographers,
and a system to help the communication

30
Thank you
for your attention
and
for your questions

Email contact: ota.cerba@seznam.cz

Web pages: http://www.kma.zcu.cz/cerba

31

Potrebbero piacerti anche