Thursday, August 28, 2008

Some ponderings on FDO Schema's


In RDBMS terms, a Schema is a collection of tables, indexes,
views, etc. in a database. Feature and RDBMS schemas do not correspond 1:1.

A Feature Schema may be stored in different RDBMS schemas and an RDBMS schema
might be composed of multiple logical schemas."

As a result of this loose definition we have no simple standard for schema and class naming across providers.

Here are some examples of different schema & class names currently in use in FDO

OSGEO.SHP reports Default:shpfilename
OSGEO.Gdal reports default:default
MySql reports Fdoreports:aquifer_property

SDF reports what ever was set as the schema name
spot the pattern ?

PostGIS has been reformed following this discussion

I really don't see the need to inject provider names into the mix? ever.

It's really confusing for people new to FDO, here's a few ideas to make
things simple

1. Providers which don't support multiple schemas, should report an empty schema,
all their content lives in that single schema ( ie was default).

2. Providers which have native schemas with multiple real schemas,
should represent those available schemas to GetSchemas unless over-ridden
in the connection string or by custom mappings.

3. The tables in the user schema are listed in empty schema (default) conceptually
potentially twice.

4. Class names for databases are normally tablename, unless qualified which
then has ~COLUMN_NAME appended. (Coz if the are multiple geometries, FDO requires
to know which one is the identifier)

5. Class names for file based providers is based on their file name as current

6. Drumroll, The empty schema ":watercourses" could be also just "watercourses"

so lets see that means
OSGEO.SHP reports filename
OSGEO.Gdal reports filename
KingOracle reports schema:tablename or if connected as "schema" then just tablename
OSGEO.OGR reports filename
MySql reports schema:tablename or if connected as "schema" then just tablename
SDF still reports what ever you like as a schema name
what's peoples thoughts on this?


Mateusz Loskot said...


Your proposal of all 6 points sounds very reasonable to me. What I'd suggest is to write a kind of more formal RFC document and send out asking for comments to the fdo-internals.

In fact, collecting comments from FDO architects on this would help users, at least me :-), to understand all this schema naming magic in FDO, its weak and strong requirements, etc.

Good job! Thansk!

Bigfoot said...

Interesting ideas. I would write up a more formal document and send out to the community. I agree with you that the naming mechanisms have each provider have adopted have been somewhat diverse and should be re-evaluated now that we have a number of providers to compare and contrast.

Greg Boone

Unknown said...

here's the follow up discussion on fdo-internals