ISO/TC 211 WG4 WI 18 Encoding Encoding CD 1.0 Vienna, Austria 1999-03-01 David Skogan Project leader work item 18 Encoding SINTEF Telecom and Informatics Email: David.Skogan@informatics.sintef.no 1999-03-01 Foil no. 1 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Content Presentation of Encoding (pre) CD (WG4-N111 1999-02-15) Demonstration 1999-03-01 Foil no. 2 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Design requirements Unified Modeling Language (UML) XML Metadata Interchange (XMI) Extensible Markup Language (XML) Modeling and naming requirements Character set requirements 1999-03-01 Foil no. 3 ISO CD 15046-18 Encoding ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Contents 1 Scope, 2 Conformance, 3 Normative references, 4 Term(s) and definition(s), 5 Symbols (and abbreviated terms) 6 Fundamental concepts and assumptions 7 Character repertoire 8 Application schema specific data structure 9 Output data structure 10Encoding service Module 1 Module 2 Module 3 Module 4 Module 5 Annex A (n) Abstract Test Suite Annex B (n) Required DTD elements Annex C (i) Extensible Markup Language (XML) Annex D (i) Character Repertoire (ISO/IEC 10646) Annex E (i) Examples 1999-03-01 Foil no. 4 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 1 Scope This part of ISO 15046 specifies the encoding rule that shall be used for data interchange purposes. The encoding rule allows geographic information defined in an application schema to be coded into a system independent data structure suitable for transport or storage. ... The encoding rule requires that an application schema shall exist and that it shall have been defined using the standardised conceptual schema language specified in part 3 – Conceptual Schema Language and that it shall be in conformance with the rules mandated in part 9 – Rules for Application schemas. The encoding rule shall be compatible with the Universal Modelling Language (UML). Since there are no encoding rules associated with UML for data interchange this part of ISO 15046 defines an encoding rule based on the Extensible Markup Language (XML). The choice of one international encoding rule does not exclude application domains and national countries to define and use their own encoding rules ... 1999-03-01 Foil no. 5 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Module 1 Data interchange System A Internal schema A Internal database MAI i Encoding service Encoding service R R-1 Transfer File services system Data transfer System boundary Foil no. 6 MIB d File Transfer system services Data flow 1999-03-01 Internal schema B i d Defines System B Application schema I System boundary Internal database ISO/TC 211 WG4 WI 18 Encoding Schema language CD 1.0 Conceptual schema language C Conceptual schema language D Encoding rule R Data structure schema D Application schema I Schema Encoding service Instances i d input output Defines 1999-03-01 Foil no. 7 Data flow Relationship ISO/TC 211 WG4 WI 18 Encoding 7 Character repertoire CD 1.0 Module 2 This standard adopts the following international character set standards: ISO/IEC 10646-1 ISO/IEC 10646-2 Encodings: UTF-8, UTF-16, UCS-2, UCS-4 These standards define an international 1999-03-01 recognised repertoire of characters and their encodings. Additional requirements Composite characters deprecated Language tagging mechanism required Foil no. 8 ISO/TC 211 WG4 WI 18 Encoding 8 Application schema specific data structure 8.1 General 8.2 Attributes and data types 8.3 Associations and association ends 8.4 Schema model 8.5 Instance model 1999-03-01 Foil no. 9 CD 1.0 Module 3 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 8.2 Attributes and data types A data type specifies a legal value domain and the operations on values of that domain Four categories a) Basic data types b) Collection data types c) Enumerated data types d) Model types 1999-03-01 Foil no. 10 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 8.2.2 Basic data types Integer 23995, -532, 0 Real 23.501, -1.23E-4 Binary FEA22A59 Boolean TRUE or FALSE String “Årlig” Date 1998-09-18 Time 18:30:59+01:00 DateTime 1998-09-18T18:30:01 DirectPosition (123, 514, 150) 1999-03-01 Foil no. 11 ISO/TC 211 WG4 WI 18 Encoding 8.2.3 Collection types A template type that indicates multiple 1999-03-01 occurrences of instances of a specific type Types Set points : Set ( GM_Point ) Bag occurrences : Bag ( Integer ) Sequence (List) points : Sequence ( GM_Point ) Dictionary named_points: Dictionary( String, GM_Point ) Foil no. 12 CD 1.0 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 8.3 Associations and association ends class1 A r2 1 association-end r1 0..* class2 association-end association class1 B r3 1..* aggregation 1999-03-01 Foil no. 13 class3 class1 C r4 1..* composition class4 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 8.4 Schema model +subpackages 0..* Package + name : String <<o>> + tag : String <<o>> + stereotype : String + qualified_name() : String Class +classes 0..* +associations 0..* Association + name : String <<o>> + stereotype : String + name : String <<o>> + tag : String + abstract : Boolean <<o>> + stereotype : String +supertypes 0..* + invariants : Sequence(OclExpression) + qualified_name() : String +properties 0..* cProperty + name : String <<o>> + tag : String + data_type : String <<o>> + stereotype : String <<o>> + multiplicity : String <<o>> + collection : String +associations 0..* cAssociation + name : String <<o>> + tag : String + target_class : String <<o>> + aggregation : Boolean <<o>> + collection : String <<o>> + multiplicity : String <<o>> + inverse_role : String +compositions 0..* cComposition + name : String <<o>> + tag : String + target_class : String <<o>> + stereotype : String <<o>> + multiplicity : String <<o>> + collection : String <<o>> + inverse_role : String +association-end 2..* AssociationEnd + role_name : String + multiplicity : String + target_class : String + aggregation_symbol : { none, aggregation, composition} <<o>> + qualifier : String <<o>> + ordered : Boolean + qualified_name() : String + qualified_name() : String + qualified_name() : String +operations 0..* Parameter + name : String 0..* + type : String +parameters <<o>> + def_value : String 1999-03-01 Foil no. 14 cOperation + name : String + return_type : String <<o>> + stereotype : String + pre_conditions : Sequence(OclExpression) + post_conditions : Sequence(OclExpression) ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Schema Model vs. UML Package Class cProperty cAssociation cComposition Basic types Association and aggregations Composition and model types Road road_no : Integer segment : GM_Curve 1999-03-01 Foil no. 15 intersect 2 Intersection pos : GM_Point ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Structure Level 0 – Complete schema Level 1 – Application schema package, name "RoadMap" Class and Association declarations Level 2 - Subpackages Level 1 – Standardised schema package, name "Spatial" Class and Association declarations Level 2 - Subpackages Level 1 – Standardised schema package, name "Quality” Class and Association declarations Level 2 - Subpackages 1999-03-01 Foil no. 16 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 8.5 Instance model Object + oid : String + class_name : String +properties 0..* +subpackages + name : String 0..* + get_objects : Sequence(ObjectReference) +associations 0..* +compositions 0..* oProperty oAssociation oComposition + name : String + name : String + name : String +value +value 0..* BasicValue +value 0..* 0..* ObjectReference +objects 0..* 1999-03-01 Foil no. 17 iPackage ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Structure Level 0 – Top package Level 1 – Application schema package, name "RoadMap" <object references to RoadMap objects, ...> Level 1 – Standardised schema package, name "Spatial" <object references to spatial objects, ... > Level 1 – Standardised schema package, name "Quality" <object references to quality objects, ... > 1999-03-01 Foil no. 18 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Modeling requirements (UML) Naming policy Start with letter, no space within names Applies to: package, class, attribute, and role names Inheritance No redeclarations, no derived attributes! Attributes Use the basic data types and template types defined in clause 8 Associations Use the three association types of UML consistently Define role names and multiplicities at both association ends whenever needed, if only one way association are needed use one-way navigation State All attributes and associations necessary for abstract state shall be defined in application schemas and standardised schemas 1999-03-01 Foil no. 19 ISO/TC 211 WG4 WI 18 Encoding 9 Output data structure 9.1 Conversion rules 9.2 XML DTD production 9.3 XML document production 9.4 Character coding 1999-03-01 Foil no. 20 CD 1.0 Module 4 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 9.1 Conversion rules Application schema Standardised schemas “XMI” c Schema model I UML Encoding Service DTD D Schema conversion rules XML Instance conversion rules Instance model i 1999-03-01 Foil no. 21 XML document d ISO/TC 211 WG4 WI 18 Encoding CD 1.0 DTD structure An XML version processing instruction and optional encoding declaration. Example: <?xml version="1.0" encoding="UCS-2" ?> The required DTD declarations. Declarations for the application schema. Declarations for any of the standardised schemas used by the application schema. 1999-03-01 Foil no. 22 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Required DTD declarations Element declarations GI GI.header GI.documentation GI.applicationSchema GI.lookupTable GI.content GI.difference GI.add GI.delete GI.update GI.Integer GI.Real GI.Binary GI.String GI.Date GI.Time GI.DateTime GI.Boolean GI.DirectPosition 1999-03-01 Foil no. 23 Entity declarations GI.element.att GI.link.att GI.Integer.cont GI.Real.cont GI.Binary.cont GI.Binary.att GI.String.cont GI.String.att GI.Date.cont GI.Time.cont GI.DateTime.cont GI.Boolean.cont GI.Boolean.att GI.DirectPosition.cont GI.Enum.cont ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Schema conversion rules Schema model DTD declarations Package Class cProperty cAssociation cComposition package element declaration object element declaration property element declaration association element declaration composition element declaration 1999-03-01 Foil no. 24 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Example c0 + a1 : Integer + a2 : Real <<optional>> + a3 : Binary + a4 : String + a5 : Date + a6 : Boolean + a7 : EnumType + a8 : Dictionary(Real , String) + a9 : DirectPosition + a10 : Sequence(Integer) c3 + no_items : Integer + pos : GM_Point 1999-03-01 Foil no. 25 +r1 c1 + a1 : Integer 1..* c2 +r1 + a2 : Integer + a3 : Date 0..* ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Package General <!ELEMENT TopPackage ( (SubPackage1, ..., SubPackageN), ( Class1 | Class2 ... | ClassN )*)> Example <!ELEMENT p ((p.c0 | p.c1 | p.c2 | p.c3)*)> 1999-03-01 Foil no. 26 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Class <!ENTITY % cProperties 'propertiesForC'> <!ENTITY % cAssociations 'associationsForC'> <!ENTITY % cCompositions 'compositionsForC'> <!ELEMENT c (%cProperties;, %cAssociations;, %cCompositions;)?> <!ATTLIST c %GI.element.att; %GI.link.att; > 1999-03-01 Foil no. 27 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Property a1: Integer <!ELEMENT p.c0.a1 %GI.Integer.cont;> a2: Real <!ELEMENT p.c0.a2 %GI.Real.cont;> a3: Binary <!ELEMENT p.c0.a3 %GI.Binary.cont;> <!ATTLIST p.c0.a3 %GI.Binary.att;> a4: String c0 + a1 : Integer + a2 : Real <<optional>> + a3 : Binary + a4 : String + a5 : Date + a6 : Boolean + a7 : EnumType + a8 : Dictionary(Real , String) + a9 : DirectPosition + a10 : Sequence(Integer) <!ELEMENT p.c0.a4 %GI.String.cont;> <!ATTLIST p.c0.a4 %GI.String.att; > ... Property entity <!ELEMENT % p.c0Properties ‘p.c0.a1, p.c0.a2, p.c0.a3?, p.c0.a4 ... 1999-03-01 Foil no. 28 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Association and composition r1 <!ELEMENT p.c0.r1 (p.c1 | p.c2)+> Association entity <!ENTITY % p.c0Associations ‘p.c0.r1’> c0’s object element declaration <!ELEMENT p.c0 (%p.c0Properties;, %p.c0Associations;)?> <!ATTLIST p.c0 %GI.element.att; %GI.link.att; > 1999-03-01 Foil no. 29 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 9.3 XML document production An XML version processing instruction and optional encoding declaration. Example: <?xml version="1.0" encoding="UCS-2" ?> A mandatory reference to an external DTD subset containing the DTD declarations for the application schema and for the standardised schemas used by the application schema. Example: <!DOCTYPE GI SYSTEM "http://www.example.org/roadmap.dtd"> Any XML element that conform to the external DTD declaration and to the application schema. <GI> <GI.header> ... </GI.header> <GI.content> <package_element> <object_element> </object_element> ... </package_element> ... </GI.content> </GI> 1999-03-01 Foil no. 30 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Instance conversion rules 1999-03-01 Instance model XML document Package Object oProperty oAssociation oComposition package element object element property element association element composition element Foil no. 31 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Choices Identification id label uuid local to XML document user defined label unique id Qualified name Tag name “Package.SubPackage.Class.Property” “cpty” Naming policy Containment model (compositions) Flat Mixed Nested 1999-03-01 Foil no. 32 Objects in appropriate packages Objects within objects ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Referencing object elements object element <e gi.id="i05" gi.label="test" gi.uuid="dce:F6A120B3"> ... </e> XML IDREF mechanism: <l gi.idref="i05"></l> Uuidref mechanism: <l gi.uuidref="dce:F6A120B3"></l> Simple link (local): <l xml:link="simple" href="|gi.label(test)"></l> Simple link (external): <l xml:link="simple" href="http://www.example.org/data.xml|i05"></l> 1999-03-01 Foil no. 33 ISO/TC 211 WG4 WI 18 Encoding 9.4 Character coding Example: <?xml version=“1.0” encoding=“ISO-10646-UCS-2”?> Legal encodings: default UTF-8 or UTF-16 “UTF-8”, “UTF-16” “ISO-10646-UCS2”, “ISO-10646-UCS-4” 1999-03-01 Foil no. 34 CD 1.0 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 10 Encoding service <<Interface>> EncodingService + generateDTD(SchemaModel m) : DTDStream + encode(SchemaModel m, InstanceModel i) : XMLStream + decode(SchemaModel m, XMLStream d) : InstanceModel 1999-03-01 Foil no. 35 Module 4 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 E.2 Example <<Feature>> Road + road_no : Integer + situation : Sequence( RoadSituation ) + segment : GM_Curve +intersection 2 <<Struct>> RoadSituation + type : St ri ng + length : R eal <<Feature>> Intersection + pos : GM_Poi nt 50500 r2 50400 i2 50300 i1 50200 10500 1999-03-01 Foil no. 36 10600 10700 10800 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Data RoadMap i01: Road road_no (p): "66" intersection (a): { i05, i06 } situation (c): { i02, i03, i04 } segment (c): i09 i02: RoadSituation type (p): "gravel" length (p): "159.5" i03: RoadSituation type (p): "asphalt" length (p): "30.5" i04: RoadSituation type (p): "concrete" length (p): "160.0" i05: Intersection pos (c): i07 i06: Intersection pos (c): i08 1999-03-01 Foil no. 37 Spatial i07: GM_Point position (p): "50400 10800" SRS (a): i11 i08: GM_Point position (p): "50300 10500" SRS (a): i11 i09: GM_Curve SRS (a) : i11 segment (c): { i10 } i10: GM_CurveSegment controlPoint (p): { "50300 10500", "50400 10600", "50400 10800" } controlParameter (p): { "1.0", "1.0", "1.0" } interpolationMethod (p): "Linear" Position i11: SpatialReferenceSystem type (p): "UTM" ISO/TC 211 WG4 WI 18 Encoding CD 1.0 RoadMap DTD <?xml version="1.0" encoding="UTF-8" ?> <!-- DTD file: roadmap.dtd --> <!-- Import fixed elements from file called "iso15046/fixed.dtd" --> <!ENTITY % GI.fixed.elements SYSTEM "iso15046/fixed.dtd" > %GI.fixed.elements; <!--The dataset's root element is the predefined GI.content element --> <!--It could have been defined as ELEMENT GI.content (RoadMap, Spatial) > <!-- PACKAGE RoadMap --> <!ELEMENT RoadMap (RoadMap.Road | RoadMap.Intersection)* > 1999-03-01 Foil no. 38 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 RoadMap DTD cont. <!-- CLASS Road --> <!ELEMENT RoadMap.Road.road_no %GI.Integer.cont; > <!ENTITY RoadMap.RoadProperties ' RoadMap.Road.road_no ' > <!ELEMENT RoadMap.Road.intersection ( RoadMap.Intersection)+ > <!ENTITY % RoadMap.RoadAssociations 'RoadMap.Road.intersection' > <!ELEMENT RoadMap.Road.situation ( RoadSituation ) > <!ELEMENT RoadMap.Road.segment ( Spatial.GM_Curve )* > <!ENTITY % RoadMap.RoadCompositions 'RoadSituation, RoadMap.Road.segment' > <!ELEMENT RoadMap.Road ( %RoadMap.RoadProperties;, %RoadMap.RoadAssociations;, %RoadMap.RoadCompositions; )? > <!ATTLIST RoadMap.Road %GI.element.att; %GI.link.att; > ... 1999-03-01 Foil no. 39 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 RoadMap data <?xml version="1.0" ?> <!DOCTYPE GI SYSTEM "roadmap.dtd" > <GI gi.version="1.0" timestamp="1999-01-06 12:00" verified="false" containment="nested" naming="qualified"> <GI.header> <GI.applicationSchema xml:link="simple" href="http://www.as.org/RoadMap/" gi.name="RoadMap" gi.version="1.2">Additional text</GI.applicationSchema> </GI.header> <GI.content> <RoadMap> <RoadMap.Road gi.id="i01"> <RoadMap.Road.road_no>66</RoadMap.Road.road_no> <RoadMap.Road.intersection> <RoadMap.Intersection gi.idref="i05"></RoadMap.Intersection> <RoadMap.Intersection gi.idref="i06"></RoadMap.Intersection> </RoadMap.Road.intersection> <RoadMap.Road.situation> ... </RoadMap.Road.situation> 1999-03-01 Foil no. 40 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 RoadMap cont. <RoadMap.Road.segment> <Spatial.GM_Curve gi.id="i09"> <Spatial.GM_Object.SRS> <Position.SpatialReferenceSystem gi.idref="i11"></Position.SpatialReferenceSystem> </Spatial.GM_Object.SRS> <Spatial.GM_Curve.segment> <Spatial.GM_CurveSegment gi.id="i10"> <Spatial.GM_CurveSegment.controlPoint>50300 10500 </Spatial.GM_CurveSegment.controlPoint> <Spatial.GM_CurveSegment.controlPoint>50400 10600 </Spatial.GM_CurveSegment.controlPoint> <Spatial.GM_CurveSegment.controlPoint>50400 10800 </Spatial.GM_CurveSegment.controlPoint> <Spatial.GM_CurveSegment.controlParameter> <GI.Real>10.5</GI.Real><GI.String>Add to c1</GI.String> </Spatial.GM_CurveSegment.controlParameter> <Spatial.GM_CurveSegment.interpolation>linear </Spatial.GM_CurveSegment.interpolation> </Spatial.GM_CurveSegment> </Spatial.GM_Curve.segment> </Spatial.GM_Curve> </RoadMap.Road.segment> </RoadMap.Road> 1999-03-01 Foil no. 41 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Tag-based naming policy RM r rno rin rsi rsg rs rst rsl i ipo SP p osr pp cs csp csa csi c csg PO srs lookup table 1999-03-01 Foil no. 42 RoadMap RoadMap.Road RoadMap.Road.road_no RoadMap.Road.intersection RoadMap.Road.situation RoadMap.Road.segment RoadMap.RoadSituation RoadMap.RoadSituation.type RoadMap.RoadSituation.length RoadMap.Intersection RoadMap.Intersection.pos Spatial Spatial.GM_Point Spatial.GM_Object.SRS Spatial.GM_Point.position Spatial.GM_CurveSegment Spatial.GM_CurveSegment.controlPoint Spatial.GM_CurveSegment.controlParameter Spatial.GM_CurveSegment.interpolation Spatial.GM_Curve Spatial.GM_Curve.segment Position Position.SpatialReferenceSystem ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Tag-based data <?xml version="1.0" ?> <!DOCTYPE GI SYSTEM "roadmap-tag.dtd" [ <!ENTITY lookup.table SYSTEM "rm-lookup.xml"] > <GI gi.version="1.0" timestamp="1999-01-06 12:00" verified="false" containment="nested" naming="qualified"> <GI.header> <GI.applicationSchema xml:link="simple" href="http://www.as.org/RM/" gi.name="RM" gi.version="1.2">Additional text</GI.applicationSchema> <GI.lookupTable>&lookup.table;</GI.lookupTable> </GI.header> <GI.content> <RM> <r gi.id="i01"> <rno>66</rno> <rin> <i gi.idref="i05"> <i gi.idref="i06"> </rin> <rsi> 1999-03-01 Foil no. 43 ISO/TC 211 WG4 WI 18 Encoding Tag-based data cont. <rsg> <c gi.id="i09"> <osr> <srs gi.idref="i11"></srs> </osr> <csg> <cs gi.id="i10"> <csp>50300 10500</csp> <csp>50400 10600</csp> <csp>50400 10800</csp> <csa><GI.Real>10.5</GI.Real><GI.String>Add to c1</GI.String></csa> <csi>linear</csi> </cs> </csg> </c> </rsg> </r> 1999-03-01 Foil no. 44 CD 1.0 ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Demonstration Java Application (applet) Model Browser and Editor Schema Model and Instance Model Encoding Service Implementation XML read/write DTD generation UML Appl. Schema “XMI Light” Std. Schemas Application data 1999-03-01 XML doc. Foil no. 45 Browser and Editor + Encoding Service DISGIS DISGIS Esprit project 22.084 1996 Taskon, INESC, SINTEF, Iona, DIKAS, GISDK, NMA DTD XML doc. ISO/TC 211 WG4 WI 18 Encoding CD 1.0 Summary Inspired by XMI and based on UML and XML M1: Data interchange (requirements) M2: Character repertoire (requirements) M3: Schema and instance data structures Data types, associations Schema Model and Instance Model M4: Output data structure (Conversion rules) DTD and XML document production Two alternative naming policies Three identification mechanisms Choice of containment model M5: Encoding Service 1999-03-01 Foil no. 46