SRW Schema Mapping
From EChase
Sample Schema Mapping File[edit]
<?xml version="1.0" encoding="UTF-8"?> <schema_mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- SCHEMA MAPPING --> <schema_name>echase</schema_name> <tables> <table> <name>information_carrier</name> <pk>id</pk> </table> <table> <name>attribution</name> <pk>id</pk> </table> <table> <name>actor</name> <pk>id</pk> </table> <table> <name>timespan</name> <pk>id</pk> </table> <table> <name>thesaurus_hierarchy</name> <pk>id</pk> </table> <table> <name>thesaurus_item</name> <pk>id</pk> <pk>lang</pk> <pk>name</pk> </table> </tables> <table_element> <name>information_carrier</name> <table> <name>information_carrier</name> <pk>id</pk> </table> <column_element> <name>collection</name> <value_column>collection</value_column> <value_type>int</value_type> </column_element> <column_element> <name>title</name> <value_column>title</value_column> <value_type>varchar</value_type> </column_element> <column_element> <name>description</name> <value_column>description</value_column> <value_type>varchar</value_type> </column_element> <table_element> <name>attribution</name> <table> <name>attribution</name> <pk>id</pk> </table> <join> <position>1</position> <parent_table> <name>information_carrier</name> <join_column>id</join_column> </parent_table> <child_table> <name>attribution</name> <join_column>information_carrier_id</join_column> </child_table> </join> <table_element> <name>actor</name> <table> <name>actor</name> <pk>id</pk> </table> <join> <position>1</position> <parent_table> <name>attribution</name> <join_column>actor_id</join_column> </parent_table> <child_table> <name>actor</name> <join_column>id</join_column> </child_table> </join> <column_element> <name>name</name> <value_column>name</value_column> <value_type>varchar</value_type> </column_element> </table_element> <table_element> <name>timespan</name> <table> <name>timespan</name> <pk>id</pk> </table> <join> <position>1</position> <parent_table> <name>attribution</name> <join_column>date_id</join_column> </parent_table> <child_table> <name>timespan</name> <join_column>id</join_column> </child_table> </join> <column_element> <name>from_date</name> <value_column>from_date</value_column> <value_type>echase_date</value_type> </column_element> <column_element> <name>from_time</name> <value_column>from_time</value_column> <value_type>time</value_type> </column_element> <column_element> <name>from_ca</name> <value_column>from_ca</value_column> <value_type>boolean</value_type> </column_element> <column_element> <name>to_date</name> <value_column>to_date</value_column> <value_type>echase_date</value_type> </column_element> <column_element> <name>to_time</name> <value_column>to_time</value_column> <value_type>time</value_type> </column_element> <column_element> <name>to_ca</name> <value_column>to_ca</value_column> <value_type>boolean</value_type> </column_element> </table_element> </table_element> <table_element> <name>thesaurus_entry</name> <table> <name>thesaurus_hierarchy</name> <pk>id</pk> </table> <join> <position>1</position> <parent_table> <name>information_carrier</name> <join_column>id</join_column> </parent_table> <child_table> <name>information_carrier_thesaurus</name> <join_column>information_carrier_id</join_column> </child_table> </join> <join> <position>2</position> <parent_table> <name>information_carrier_thesaurus</name> <join_column>hierarchy</join_column> </parent_table> <child_table> <name>thesaurus_hierarchy</name> <join_column>hierarchy</join_column> </child_table> </join> <column_element> <name>id</name> <value_column>id</value_column> <value_type>int</value_type> </column_element> <column_element> <name>hierarchy</name> <value_column>hierarchy</value_column> <value_type>varchar</value_type> </column_element> <table_element> <name>item</name> <table> <name>thesaurus_item</name> <pk>id</pk> <pk>lang</pk> <pk>name</pk> </table> <join> <position>1</position> <parent_table> <name>thesaurus_hierarchy</name> <join_column>id</join_column> </parent_table> <child_table> <name>thesaurus_item</name> <join_column>id</join_column> </child_table> </join> <column_element> <name>lang</name> <value_column>lang</value_column> <value_type>varchar</value_type> </column_element> <column_element> <name>name</name> <value_column>name</value_column> <value_type>varchar</value_type> </column_element> <column_element> <name>preffered_name</name> <value_column>preffered_name</value_column> <value_type>boolean</value_type> </column_element> </table_element> </table_element> </table_element> <!-- EXAMPLE XML FOR SCHEMA --> <!-- <information_carrier> <collection/> <title/> <description/> <attribution> <actor> <name/> </actor> <place/> <timespan> <from_date/> <from_time/> <from_ca/> <to_date/> <to_time/> <to_ca/> </timespan> </attribution> <thesaurus_entry> <id/> <hierarchy/> <item> <lang/> <name/> <preffered/> </item> </thesaurus_entry> </information_carrier> --> </schema_mapping>