Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa...

29
Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC

Transcript of Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa...

Page 1: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

Towards Automatic Feature Type Publication

Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa

Universidade Federal do Ceará – UFC

Page 2: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Outline Motivation Our Approach Feature Type Publication by Deegree WFS Algorithm GenerateDataStoreConfigurationFile DFP: An Environment for Deegree Feature

Type Publication Conclusions

Page 3: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Motivation The purpose of the WFS specification is to describe

the manipulation operations over geospatial data using GML

WFS Servers provide queries, update and exchange of geospatial data, stored in data sources, as geographic features instances encoded in GML.

The publication of a feature type is largely manual The generation of the configuration file is a tedious and

error-prone task. In case of modifications of the database schema, many

feature types can be affected.

Page 4: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Automatic Feature Type Publication

1. The base source schema is converted to an XML schema.

2. The User defines the feature type XML schema;

3. The correspondence assertions of the feature type are generated by matching the feature type schema and the base source XML schema.

4. The configuration file required to publish the feature type is automatically generated.

Page 5: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

Mapping Relational Schema to XMLS+ Schema

SchoolProjcodeschoolcodeproject

Projectcode (PK)titledescription

Schoolcode (PK)namegradestreetcityzipcodegeom

FK2

FK1

Project (TProject)tuple_project * (Ttuple_Project)

code (integer)title (string)description (string)keyRef2

-1 (&Ttuple_SchoolProj)

SchoolProj (TSchoolProj)tuple_schoolproj * (Ttuple_SchoolProj)

codeschool (integer)codeproject (integer)keyRef1 (&Ttuple_School)keyRef2 (&Ttuple_Project)

Troot [XML_School]

School (TSchool)tuple_school * (Ttuple_School)

code (integer)name (string)

keyRef1-1 (&Ttuple_SchoolProj)

grade (string)street (string)city (string)zipcode (string)geom (geometry)

Page 6: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Type A Feature Type F is defined by a 4-tuple

F=< TF, RM, AF > where:

TF is the feature type schema

RM is the Master table (each feature instance

of F matches a tuple of RM )

AF is the set of path correspondence

assertions that matches the proprieties of TF

with attributes/path of the Master table

Page 7: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Type SchoolF

2 : [TSchoolF/codeF] [Ttuple_School/code]

3 : [TSchoolF/geometryF] [Ttuple_School/geom]

4 : [TSchoolF/nameF] [Ttuple_School/name]

5 : [TSchoolF/gradeF] [Ttuple_School/grade]

6 : [TSchoolF/addressF,{streetF,cityF,zipcodeF}] [Ttuple_School/{street,city,zipcode}]

7 : [TSchoolF/projectF] [Ttuple_School/keyref1-1/keyref2]

8 : [TProjectF/codeF] [Ttuple_Project/code]

9 : [TProjectF/titleF] [Ttuple_Project/title]

TSchoolF

code

name

geometry

grade

city zipcode

addressstreet

project *

code

title

Ttuple_school

zipcode

grade

street

code

geom

name

city

codeschool codeproject

keyref1-1 (&Ttuple_SchoolProj)

keyref2 (&Ttuple_Project)

keyref1 (&Ttuple_School)

code title descriptionkeyref2-1 (&Ttuple_SchoolProj)

Master´s table type

Page 8: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Publication by Deegree WFS

1. Register the Feature Type in the capabilities document (WFS Capabilities)

2. Generate the DataStoreConfiguration (DSC) File. The DSC file consists of three parts:

Heading MappingFields MappingTables Footing

XML

XML

XML

XML

Page 9: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Publication by Deegree WFS The MappingFields and MappingTables can be

automatically generated based on the feature type schema and its set of Correspondence Assertions.

All the assertions should be of the form [TF / p][Ttuple_R/e].

We may have to adjust the feature type schema.

Page 10: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Type SchoolF

2 : [TSchoolF/codeF] [Ttuple_School/code]

3 : [TSchoolF/geometryF] [Ttuple_School/geom]

4 : [TSchoolF/nameF] [Ttuple_School/name]

5 : [TSchoolF/gradeF] [Ttuple_School/grade]

6 : [TSchoolF/addressF,{streetF,cityF,zipcodeF}] [Ttuple_School/{street,city,zipcode}]

7 : [TSchoolF/projectF] [Ttuple_School/keyref1-1/keyref2]

8 : [TProjectF/codeF] [Ttuple_Project/code]

9 : [TProjectF/titleF] [Ttuple_Project/title]

TSchoolF

code

name

geometry

grade

city zipcode

addressstreet

project *

code

title

Ttuple_school

zipcode

grade

street

code

geom

name

city

codeschool codeproject

keyref1-1 (&Ttuple_SchoolProj)

keyref2 (&Ttuple_Project)

keyref1 (&Ttuple_School)

code title descriptionkeyref2-1 (&Ttuple_SchoolProj)

Master´s table type

Cannot represent the mapping fields for PCAs 6 and 7

Page 11: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Type SchoolF

TSchoolF

code

name

geometry

grade

addressstreet city zipcode

project *

code

title

Ttuple_school

zipcode

grade

street

code

geom

name

city

codeschool codeproject

keyref1-1

keyref2

keyref1

code title descriptionkeyref2-1

Canonical Schema

TSchoolf

code

title

project *

code

zipcode

Keyref1-1

grade

street

geometry

name

city

[Tschoolf/codeF] [Ttuple_School/code]

[Tschoolf/geomF] [Ttuple_School/geom]

[Tschoolf/nameF] [Ttuple_School/name]

[Tschoolf/gradeF] [Ttuple_School/grade]

[Tschoolf/streetF] [Ttuple_School/street]

[Tschoolf/cityF] [Ttuple_School/city][Tschoolf/zipcodeF][Ttuple_School/zipcode]

[Tschoolf/keyref1-1] [Ttuple_School/keyref1

-1]

[TProject/codeF] [Ttuple_Project/code]

[TProject/titleF] [Ttuple_Project/title]

[Tkeyref1-1/project] [Ttuple_Schoolproj/keyref2]

Page 12: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

GenerateDeegreeConfigurationFile Algorithm

/* INPUT: TF - The Feature Type shema

RM - The Master Table

AF - The set o PCAs

*/ Let Map be a string, initially empty.

Map + = GenerateFileHeading();

Map + = GenerateMappingFields(TF, Ttuple_RM);

Map + = GenerateMappingTables(RM);

Map + = GenerateFileFooting();

Return Map

Page 13: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Type Schema Designer

1Feature Type

Schema

Schema Matching Tool

2

DFP: An Environment for Deegree Feature Type Publication

UserBD

Base SourceSchema

CorrespondenceAssertions

Canonical Feature Type Schema

Style File

DSC File Generator

3DSC File

Page 14: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

DFP and Deegree Files

Capabilities(.xml)

Feature Type Schema(.xsd)

DSC File(.xml)

FeatureType

Feature Type PropertiesRepository (.xml)

Correspondence Assertions Repository

(.xml)

DB

Master Table and RelatedTables Repository (.xml)

Extract

Deegree Servers List

(.xml)

Oracle Servers List

(.xml)

Feature Typeslist

(.xml)

Register

Generate

General informations and local path of capabilities file

Connection informations and local path of tables repository file

Feature Types and l local path of their repositories files

Legend:

Deegree Files

DFP Files

Generate

Page 15: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Conclusions We proposed an approach for automatic feature

type publication by WFS servers. A feature type is specified by a Schema and a

set of Corresp. Assertions. Our formalism handles schematic heterogeneity,

and allows complex mappings to be specified quite simply.

We presented an algorithm that automatically generates the DataStoreConfiguration file required to publish a feature type by a Deegree WFS.

Page 16: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Conclusions We have developed DFP, a tool to

support the publication of features by Deegree WFS.

Page 17: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

Towards Automatic Feature Type Publication

Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa

Universidade Federal do Ceará – UFC

Page 18: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Deegree Feature Publisher

Page 19: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Type Schema Designer

Page 20: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Feature Type Schema Designer

Page 21: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

SMT – Schema Matching Tool

Page 22: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Heading (DataStoreConfiguration File)

<?xml version="1.0" encoding="UTF-8"?><DatastoreConfiguration name="SCHOOL" type="ORACLESPATIAL"> <Connection name="SCHOOL_con"> <driver>oracle.jdbc.driver.OracleDriver</driver> <logon>jdbc:oracle:thin:@127.0.0.1:1521:dbGEOM</logon> <user>geoUser</user> <password>geoUser</password> <spatialversion>8.1.6</spatialversion> </Connection> <FeatureType name="SCHOOL"> <OutputFormat> <GML2 responsibleClass="org.deegree_impl.services.wfs.oracle. DataStoreOutputGML"> <Param name="FILTER" value="file:///.../SchoolTransf.xsl"/> <SchemaLocation>file:///…/SCHOOLSchema.xsd </SchemaLocation> </GML2> </OutputFormat> . . .

Page 23: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

MappingFields (DataStoreConfiguration File) . . .<MappingField> <Property name="NAME" type="xsd:string"/> -- (4 : [TSchoolF/nameF] [Ttuple_School/name]) <DatastoreField name="SCHOOLL.NAME" type="VARCHAR2"/></MappingField><MappingField> <Property name="GRADE" type="xsd:string"/> -- (5 : [TSchoolF/gradeF] [Ttuple_School/grade]) <DatastoreField name="SCHOOL.GRADE" type="VARCHAR2"/></MappingField> <Property name="CODE" type="xsd:integer"/> -- (2 : [TSchoolF/codeF] [Ttuple_School/code) <DatastoreField name="PROJECT.CODE" type="NUMBER"/></MappingField><MappingField> <Property name="TITLE" type="xsd:string"/> -- (9 : [TProjectF/titleF] [Ttuple_Project/title]) <DatastoreField name="PROJECT.TITLE" type="VARCHAR2"/></MappingField>. . .

Page 24: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

MappingTables (DataStoreConfiguration File) . . .<MasterTable name="SCHOOL" targetName="SCHOOL"> <IdField number="true" auto="false">CODE</IdField> <Reference tableField="CODE" replaceable="true" targetTable="SCHOOLPROJ" targetField="CODESCHOOL"/> <GeoFieldIdentifier>GEOM</GeoFieldIdentifier></MasterTable><RelatedTable name="SCHOOLPROJ" targetName="SCHOOLPROJ“ jointable="false"> <IdField number="true" auto="false">CODESCHOOL</IdField> <Reference tableField="CODEPROJECT" replaceable="true" targetTable="PROJECT" targetField="CODE"/></RelatedTable><RelatedTable name="PROJECT" targetName="PROJECT" jointable="false"> <IdField number="true" auto="false">CODE</IdField></RelatedTable>. . .

Page 25: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

Footing (DataStoreConfiguration File)

. . .<CRS>EPSG:4326</CRS></FeatureType>

</DatastoreConfiguration>

Page 26: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

GenerateMappingFields Procedure

Procedure GenerateMappingFields (T, Ttuple_R)Let Map be a string, initially empty and visitedTables[ ] be a set. visitedTables[ ] = visitedTables[ ] R

For each property p of T Do Case 1: If p is of the form [T/p][Ttuple_R/e], where the type of e is a simple type. Map + = “<MappingField>” “<Property name=’ “+ p + “ ’ type=’ “ + getGMLType(p) + “ ’/>” “<DatastoreField name=’ “ + R + "." + e + “ ’ type=’ “ + getType(e) + “ ’/>” “</MappingField>” Case 2: If p is of the form [T/p][Ttuple_R/e], where e is a reference element and targetTable(e) = Rt . Map + = “<MappinField>” “<Property name=’ “ + p + “ ’ type=’ “ + getGMLType(tableField(e)) + “ ’/>“ “<DatastoreField name=’ “ + R + “.”+ tableField(e) + “ ‘ type= ‘ ”+ getType(tableField(e)) + “ ’/> ” “</MappingField>” If Rt visitedTables[ ] Then GenerateMappingFields(Tp , Ttuple_Rt) End IfEnd For

Page 27: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

GenerateMappingTables Procedure

Procedure GenerateMappingTables(RM)

Let Map be a string, initially empty. Let RM be the Master table where Key(RM) = {kM}. Let Ag the geometric atribute of RM.

Map = “<MasterTable name=’ "+ RM + " ‘ targetName= ‘ "+ RM + " ’> “

“<IdField number= ‘ " + IsNumber(getType(kM)) + " ‘ auto =’false’> “ + kM + “

</IdField>” Map += GenerateReferenceFields(RM)

Map += “<GeomFieldIdentifier>” + Ag + “</GeomFieldIdentifier>”

Map += “</MasterTable>”

For each R in RelTab(RM) Do

Map += “<RelatedTable name=’ "+ R + " ’ targetName= ‘ "+ R + " ‘>“ “<IdField number=’ “ + IsNumber(getType(kR)) + " ‘ auto =’false’> ” + KR +

“</IdField>” Map += GenerateReferenceFields (R) Map += “</RelatedTable>” End For

Return Map

Page 28: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

GenerateReferenceFields Procedure

Procedure GenerateReferenceFields(R) Let Reference be a string, initially empty. For each e in Ref(R) Do Reference += <Reference tableField=‘" + tableField(e) + “’ replaceable=‘true’ targetTable=‘" + targetTable(e) + "’ targetField=‘" + targetField(e) + “’/>” End For

Return Reference

Page 29: Towards Automatic Feature Type Publication Vânia M. P. Vidal, Marcel Teixeira, Fábio Feitosa Universidade Federal do Ceará – UFC.

GeoInfo 2004

WFS Capabilities

<WFS_Capabilities version="1.0.0"> . . . <FeatureTypeList> . . . <FeatureType> <ResponsibleClass className="org.deegree_impl.services.wfs.oracle.OracleDataStore" configURL="file:///...SCHOOL_DSC.xml"/> <Name>SCHOOL</Name> <Title> Feature type automatically publicated by Deegree Feature Publisher </Title> <SRS>4326</SRS> <LatLonBoundingBox minx="0" miny="0" maxx="180" maxy="90"/> </FeatureType> </FeatureTypeList></WFS_Capabilities>