SRW Design Issues

From EChase
Jump to: navigation, search

Thesaurus Issues[edit]

Mapping a single table to many parent tables poses a problem in the SRW for joining the tables in the correct manner without eliminating or adding results in error.

This is a problem for thesauri. I propose queries for thesauri items in CQL should use the hierarchy id. e.g. CQL: place = "1216.1231" where 1216.1231 refers to London. For query expansion CQL: place = "1216.1231*" would find all places matching London and within London. When results are returned there are 2 possible options.

1. Return the id and let the application query the thesaurus for the appropriate name.

 <information_carrier>
	<place>1216.1231</place>
 </information_carrier>
 

2. Return the thesaurus item id with all synonyms and translations that the application can display as necessary.

 <information_carrier>
	<place>
		<thesaurus>
			<id>1231</id>
	 		<hierarchy_id>1216.1231</hierarchy_id>
			<item>
				<lang>en-GB</lang>
	 			<name>London</name>
				<prefered_name>true</prefered_name>
			</item>
			<item>
				<lang>en-GB</lang>
				<name>The City</name>
				<prefered_name>false</prefered_name>
			</item>
			<item>
				<lang>fr-FR</lang>
				<name>Londres</name>
				<prefered_name>true</prefered_name>
			</item>
		</thesaurus>
	</place>
 </information_carrier>
 

Example Query allowing multiple joins to the same table[edit]

  select * from information_carrier
  left outer join information_carrier_thesaurus on information_carrier.id = information_carrier_thesaurus.information_carrier_id
  left outer join thesaurus_item as thesaurus1 on information_carrier_thesaurus.thesaurus_hierarchy_id = thesaurus1.id
  left outer join information_carrier_thesaurus2 on information_carrier.id = information_carrier_thesaurus2.information_carrier_id
  left outer join thesaurus_item as thesaurus2 on information_carrier_thesaurus2.thesaurus_hierarchy_id = thesaurus2.id
  left outer join attribution as production_attribution on information_carrier.id = production_attribution.information_carrier_id
  left outer join actor as attribution_actor on production_attribution.actor_id = attribution_actor.id
  where information_carrier.id = 350;