Changes between Version 1 and Version 2 of FdoEnhancedSchemaNameSupport
- Timestamp:
- 10/18/07 14:30:51 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FdoEnhancedSchemaNameSupport
v1 v2 1 2 == !!!!! NOTE: UNDER CONSTRUCTION == 1 3 2 4 == FDO Enhanced Schema Name Support == … … 8 10 The FDO API provides functions for translating FDO Feature Schemas to and from the !OpenGeospatial GML format. These functions are provided to satisfy 4 main use cases: 9 11 10 ''Export/Import'': to provide a text based export format for FDO Feature Schemas. This export format actually covers other types of objects such as Spatial Contexts, Schema Overrides and Features. However, only Feature Schemas are pertinent to this document.12 • Export/Import: to provide a text based export format for FDO Feature Schemas. This export format actually covers other types of objects such as Spatial Contexts, Schema Overrides and Features. However, only Feature Schemas are pertinent to this document. 11 13 12 ''Schema Exchange'': Allow exchange of schemas between FDO and external GML-based applications.14 • Schema Exchange: Allow exchange of schemas between FDO and external GML-based applications. 13 15 14 ''WFS Provider'': used by the FDO WFS Provider to translated GML schemas, provided by the connected WFS, to FDO Schemas.16 • WFS Provider: used by the FDO WFS Provider to translated GML schemas, provided by the connected WFS, to FDO Schemas. 15 17 16 ''Publish as WFS'': Allow FDO accessible data to be published via a WFS. This is the opposite of the previous use case.18 • Publish as WFS: Allow FDO accessible data to be published via a WFS. This is the opposite of the previous use case. 17 19 18 20 One of the big challenges, in translating schemas between FDO and GML, is the converting of schema names. In order to support the above use cases, these conversions must satisfy the following general requirements: 19 21 20 • round trip fidelity. If the schema is translated from GML to FDO to GML, the schema name in the resulting GML schema document must be the same as in the original. Similarly, the name must not change when translated from FDO to GML to FDO.[[br]] 22 • round trip fidelity. If the schema is translated from GML to FDO to GML, the schema name in the resulting GML schema document must be the same as in the original. Similarly, the name must not change when translated from FDO to GML to FDO. 23 21 24 • name uniqueness must be preserved. Different GML schemas must get different FDO schema names when read into FDO. Conversely different FDO schemas must get different GML schema names when written to GML. If name uniqueness is not preserved, schemas will be unexpectedly merged on read or write. 22 25 23 26 The structure of schema names differs greatly in either format: 24 27 25 • in FDO, a schema name is a free-form name, containing any character except '.' and ':'. Names tend to be short; more detailed information is typically kept in the schema description.[[br]] 28 • in FDO, a schema name is a free-form name, containing any character except '.' and ':'. Names tend to be short; more detailed information is typically kept in the schema description. 29 26 30 • in GML, the schema name must be a valid URI. Most current FDO schema names are valid URI's. However, most GML schema names tend to conform to the http scheme (see glossary), as seen in the following example. FDO Schema names would tend to not fit the http scheme. 27 31 … … 33 37 34 38 The FDO API provides a number of methods to ensure round trip fidelity and preservation of schema name uniqueness. However, these methods are cumbersome for some of the abovementioned use cases. This document looks at alternatives for making schema name translation easier when performed through the FDO API. 39 40 === Current API === 41 42 Feature Schema translation is provided by 2 functions on !FdoFeatureSchemaCollection: 43 44 • !ReadXml() converts GML schemas to FDO[[br]] 45 • !WriteXml() converts FDO schemas to GML (!WriteXml() is also present on !FdoFeatureSchema to allow the writing of individual schemas). 46 47 Both of the above functions take optional !FdoXmlFlags parameters, which control how the translation is performed. 48 49 The following sub-sections look at the various schema name translation options currently provided: 50 51 ==== Default Translation ==== 52 53 ===== FDO to GML ===== 54 55 When no !FdoXmlFlags are specified, the FDO schema name is translated by prepending a default osgeo-defined schema prefix (http://fdo.osgeo.org/schemas/feature/) to the schema name and escaping any characters not allowed in a URI. For example, the FDO Schema "Water Service" becomes: 56 57 http://fdo.osgeo.org.schemas/feature/Water-x20-Service 58 59 ===== GML to FDO ===== 60 61 When no !FdoXmlFlags are specified, GML schema names are translated by dropping any http:// prefix and escaping '.' and ':' to '-dot-' and '-colon-' respectively. This means that the example schema name from the Overview: 62 63 http://www.mycity.on.ca/departments/transportation/Roads 64 65 becomes: 66 67 www-dot-mycity-dot-on-dot-ca/departments/transportation/Roads 68 69 This preserves name uniqueness but leads to a rather messy looking FDO schema name that is not easily human-readable. 70 71 When the GML schema name begins with the default schema prefix (http://fdo.osgeo.org/schemas/feature/), this whole prefix is removed from the schema name. For example: 72 73 http://fdo.osgeo.org/schemas/Roads 74 75 simply becomes: 76 77 Roads. 78 79 This is done to preserve round-trip fidelity. 80 81 ===== Use Case Implications ===== 82 83 ====== Export/Import ====== 84 85 The Default method works well for the Export/Import use case. The schema name is preserved on round trip from FDO to GML to FDO. The http://fdo.osgeo.org/schemas/feature/ prefix is added when the feature schemas are written to GML and removed when they are read back from GML. The fact that the GML schemas all look like they're owned by OSGeo is not an issue. Actors, for this use case, aren't concerned about the GML format itself; they just want to be able to export FDO schemas and re-import them later. 86 87 ====== Schema Exchange ====== 88 89 The Default method does not work well for the Schema Exchange use case, since it generates rather messy FDO schema names from the GML names. Also, when FDO schemas are written to GML, the schema name always gets the default prefix prepended. Most customers would likely want the GML schema name to be a URI that reflects their own organization, rather than OSGeo. 90 91 There is also a defect which occurs when a schema name, that doesn't start with the default prefix, is round tripped from GML to FDO to GML. The GML Schema name: 92 93 http://www.mycity.on.ca/departments/transportation/Roads 94 95 becomes: 96 97 www-dot-mycity-dot-on-dot-ca/departments/transportation/Roads 98 99 in FDO. However, when written back to GML, the default prefix is still prepended to the schema name, giving: 100 101 http: //fdo.osgeo.org/schemas/feature/www.mycity.on.ca/departments/transportation/Roads 102 103 Therefore, round trip fidelity is not preserved. 104 105 ====== WFS Provider ====== 106 107 The Default method is not applicable to the WFS Provider use case. The WFS Provider always passes FdoXmlFlags to the ReadXml function. 108 109 ====== Publish as WFS ====== 110 111 As with the Schema Exchange use case, the default method does not work well for the Publish as WFS use case since all schema names end up prefixed with http://fdo.osgeo.org/schemas/feature/. 112 113 114