Revision: 52540 Author: daniel Date: 2009-06-29 12:10:06 +0000 (Mon, 29 Jun 2009)
Log Message: ----------- documenting integrator defaults/built-ins Modified Paths: -------------- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/AbstractIntegratorApp.java trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/ambiguous.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/best-mappings.properties trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/build-mappings.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/buildConceptAssociations.bsh trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/buildConceptMappings.bsh trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/definitions.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/drop.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/exclusive-mappings.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/filterConceptMappings.bsh trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/list.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/loadForeignProperties.bsh trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-properties.properties trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-single-property.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-terms.properties trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-terms.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/newIntegratorApp.bsh trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/runSql.bsh trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/scriptURL.bsh trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/terms.sql trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/unique-mappings.properties trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/unmapped.sql Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/AbstractIntegratorApp.java =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/AbstractIntegratorApp.java 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/AbstractIntegratorApp.java 2009-06-29 12:10:06 UTC (rev 52540) @@ -359,6 +359,7 @@ String def = d.getTweak("defaults", (String)null); if (def!=null) { + if (!def.endsWith(".properties")) def += ".properties"; FeatureSetSourceDescriptor dd = loadSourceDescriptor(def, false, true, null); dd.setTweaks(d); d = dd; Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/ambiguous.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/ambiguous.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/ambiguous.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,10 @@ +-- This script lists all ambiguous mappings, that is, all mappings that map a single foreign concept +-- to multiple WikiWord concepts +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * wikiword_mapping_table: the mapping table to process + SELECT foreign_authority, foreign_id, foreign_name, COUNT(distinct concept) as c, group_concat(concept_name separator "|") as concept_names FROM /* wikiword_prefix *//* wikiword_mapping_table */ as M Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/best-mappings.properties =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/best-mappings.properties 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/best-mappings.properties 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +# default settings for disambiguating mappings using the mest-match method + foreign-authority-field="foreign_authority" foreign-id-field="foreign_id" concept-id-field="concept" Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/build-mappings.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/build-mappings.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/build-mappings.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,10 @@ +-- This script groups associations by foreign concept id and target concept id, +-- this providing a list of candidate mappings. +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * wikiword_mapping_table: the mapping table to process + SELECT foreign_authority, foreign_id, foreign_name, concept, concept_name, sum(weight) as weight, group_concat(concat(concept_property, "=", value) separator "|") as annotation Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/buildConceptAssociations.bsh =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/buildConceptAssociations.bsh 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/buildConceptAssociations.bsh 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +/* defines the buildConceptAssociations command */ + import de.brightbyte.wikiword.integrator.*; buildConceptAssociations( table, source ) { Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/buildConceptMappings.bsh =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/buildConceptMappings.bsh 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/buildConceptMappings.bsh 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +/* defines the buildConceptMeanings() command */ + import de.brightbyte.wikiword.integrator.*; buildConceptMappings( table, source ) { Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/definitions.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/definitions.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/definitions.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,10 @@ +-- This script attaches definitions to each entry of a mapping table, +-- if a definition is known. +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * wikiword_mapping_table: the mapping table to process + SELECT M.*, D.definition FROM /* wikiword_prefix *//* wikiword_mapping_table */ as M JOIN /* wikiword_prefix */definition as D Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/drop.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/drop.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/drop.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1 +1,7 @@ +-- This script drops a table +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * wikiword_mapping_table: the (mapping) table to drop + DROP TABLE IF EXISTS /* wikiword_prefix *//* wikiword_mapping_table */; \ No newline at end of file Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/exclusive-mappings.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/exclusive-mappings.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/exclusive-mappings.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,11 @@ +-- This script reduces a table of mappings to those which contain +-- only one member per group. The grouping criteria are provided by an option. +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * wikiword_mapping_table: the mapping table to process +-- * group_fields: the fields to group by + SELECT * FROM /* wikiword_prefix *//* wikiword_mapping_table */ GROUP BY /* group_fields */ HAVING count(*) = 1 Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/filterConceptMappings.bsh =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/filterConceptMappings.bsh 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/filterConceptMappings.bsh 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +/* defines the command filterConceptMappings() */ + import de.brightbyte.wikiword.integrator.*; filterConceptMappings( table, source ) { Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/list.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/list.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/list.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1 +1,11 @@ +-- This script reduces a table of mappings to those which contain +-- only one member per group. The grouping criteria are provided by an option. +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * wikiword_mapping_table: the mapping table to process +-- * list_fields: the fields to group by. Optional, defaults to * (all) +-- * list_order: order clause. Optional. Must start with "ORDER BY" if given. +-- * list_limit: limit clause. Optional. Must start with "LIMIT" if given. + SELECT /* list_fields | * */ FROM /* wikiword_prefix *//* wikiword_mapping_table */ /* list_order */ /* list_limit */; \ No newline at end of file Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/loadForeignProperties.bsh =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/loadForeignProperties.bsh 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/loadForeignProperties.bsh 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +/* defines the loadForeignProperties() command */ + import de.brightbyte.wikiword.integrator.*; loadForeignProperties( table, source ) { Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-properties.properties =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-properties.properties 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-properties.properties 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +# default settings for mapping concepts using property values + foreign-authority-field="foreign_authority" foreign-id-field="foreign_id" concept-id-field="concept" Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-single-property.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-single-property.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-single-property.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,14 @@ +-- This script generates associations between a general foreign property table +-- as generated by loadForeignProperties and WikiWord, using the value of +-- a single specific property. +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * foreign_properties_table: the table containing the foreign entities/properties +-- * foreign_authority_name: name of the foreign authority (scope if the foreign proeprty name) +-- * foreign_property_name: name of the property in the foreign property table. +-- * concept_property_name: name of the property in WikiWord's property table. + SELECT foreign_authority, foreign_id, concept, concept_name, F.property as foreign_property, P.property as concept_property, Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-terms.properties =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-terms.properties 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-terms.properties 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +# default settings for mapping concepts using terms + foreign-authority-field="foreign_authority" foreign-id-field="foreign_id" concept-id-field="concept" Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-terms.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-terms.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/match-terms.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,14 @@ +-- This script generates associations between a general foreign property table +-- as generated by loadForeignProperties and WikiWord, by matching the value +-- of a (name/synonym) property against WikiWord's maaning table, that is, against known +-- terms refering to concepts. +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * foreign_properties_table: the table containing the foreign entities/properties +-- * foreign_authority_name: name of the foreign authority (scope if the foreign proeprty name) +-- * foreign_property_name: name of the (name/synonym) property in the foreign property table. + SELECT foreign_authority, foreign_id, concept, concept_name, F.property as foreign_property, "_TERM_" as concept_property, Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/newIntegratorApp.bsh =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/newIntegratorApp.bsh 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/newIntegratorApp.bsh 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +/* defines the newIntegratorApp command, which is used internally to instantiate and initialize application objects */ + import de.brightbyte.wikiword.integrator.*; newIntegratorApp( type, table, source ) { Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/runSql.bsh =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/runSql.bsh 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/runSql.bsh 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +/* defines the runSQL() command */ + import de.brightbyte.db.*; import de.brightbyte.wikiword.integrator.*; Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/scriptURL.bsh =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/scriptURL.bsh 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/scriptURL.bsh 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,9 @@ +/* +* defines the scriptURL command. scriptURL converts a relative path to a URL, using +* the value of the global variable scriptBaseUrl as the basis. scriptBaseUrl is automatically +* set to the location of the original script which is run from RunIntegratorScript. +*/ + scriptURL( path ) { return new java.net.URL(scriptBaseUrl, path).toString(); } \ No newline at end of file Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/terms.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/terms.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/terms.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,10 @@ +-- This script attaches terms (synonyms) to each entry of a mapping table. +-- Mapping rows will be duplicated for each term. +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * wikiword_mapping_table: the mapping table to process + SELECT M.*, T.term_text, T.freq, T.rule FROM /* wikiword_prefix *//* wikiword_mapping_table */ as M JOIN /* wikiword_prefix */meaning as T Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/unique-mappings.properties =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/unique-mappings.properties 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/unique-mappings.properties 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,5 @@ +# default settings for selecting unique mappings from a mappings table + foreign-authority-field="foreign_authority" foreign-id-field="foreign_id" concept-id-field="concept" Modified: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/unmapped.sql =================================================================== --- trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/unmapped.sql 2009-06-29 12:09:21 UTC (rev 52539) +++ trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/unmapped.sql 2009-06-29 12:10:06 UTC (rev 52540) @@ -1,3 +1,11 @@ +-- List the entries from a foreign property table which are not mapped by +-- a given mapping table. +-- +-- Parameters: +-- * wikiword_prefix: the global table prefix. Provided automatically +-- * wikiword_foreign_table: the foreign property table to process +-- * wikiword_mapping_table: the mapping table to match against + SELECT F.foreign_authority, F.foreign_id FROM /* wikiword_prefix *//* wikiword_mapping_table */ as M RIGHT JOIN /* wikiword_prefix *//* wikiword_foreign_table */ as F _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs