Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug-978722_data-cleaning into lp:zorba/data-cleaning-module.
Requested reviews: Matthias Brantner (matthias-brantner) William Candillon (wcandillon) Related bugs: Bug #978722 in Zorba: "change annotation prefix from "ann" to "an"" https://bugs.launchpad.net/zorba/+bug/978722 For more details, see: https://code.launchpad.net/~zorba-coders/zorba/bug-978722_data-cleaning/+merge/101532 fix for bug #978722 (change annotation prefix from "ann" to "an") -- https://code.launchpad.net/~zorba-coders/zorba/bug-978722_data-cleaning/+merge/101532 Your team Zorba Coders is subscribed to branch lp:zorba/data-cleaning-module.
=== modified file 'src/com/zorba-xquery/www/modules/data-cleaning/conversion.xq' --- src/com/zorba-xquery/www/modules/data-cleaning/conversion.xq 2011-11-16 18:41:39 +0000 +++ src/com/zorba-xquery/www/modules/data-cleaning/conversion.xq 2012-04-11 10:14:19 +0000 @@ -29,7 +29,7 @@ module namespace conversion = "http://www.zorba-xquery.com/modules/data-cleaning/conversion"; declare namespace exref = "http://www.ecb.int/vocabulary/2002-08-01/eurofxref"; -declare namespace ann = "http://www.zorba-xquery.com/annotations"; +declare namespace an = "http://www.zorba-xquery.com/annotations"; import schema namespace wp = 'http://api.whitepages.com/schema/'; @@ -52,7 +52,7 @@ : @return A sequence of strings for the phone numbers associated to the name. : @example test/Queries/data-cleaning/conversion/phone-from-user.xq :) -declare %ann:nondeterministic function conversion:phone-from-user ( $name as xs:string) as xs:string*{ +declare %an:nondeterministic function conversion:phone-from-user ( $name as xs:string) as xs:string*{ let $name-value := replace($name, " ", "%20") let $url := concat("http://api.whitepages.com/find_person/1.0/?name=",$name-value,";api_key=",$conversion:key) let $doc := http:get-node($url)[2] @@ -69,7 +69,7 @@ : @return A sequence of strings for the addresses associated to the name. : @example test/Queries/data-cleaning/conversion/address-from-user.xq :) -declare %ann:nondeterministic function conversion:address-from-user ( $name as xs:string) as xs:string*{ +declare %an:nondeterministic function conversion:address-from-user ( $name as xs:string) as xs:string*{ let $name-value := replace($name, " ", "%20") let $url := concat("http://api.whitepages.com/find_person/1.0/?name=",$name-value,";api_key=",$conversion:key) let $doc := http:get-node($url)[2] @@ -91,7 +91,7 @@ : @return A sequence of strings for the person or organization's name associated to the phone number. : @example test/Queries/data-cleaning/conversion/user-from-phone.xq :) -declare %ann:nondeterministic function conversion:user-from-phone ( $phone-number as xs:string) as xs:string*{ +declare %an:nondeterministic function conversion:user-from-phone ( $phone-number as xs:string) as xs:string*{ let $url := concat("http://api.whitepages.com/reverse_phone/1.0/?phone=",$phone-number,";api_key=",$conversion:key) let $doc := http:get-node($url)[2] return $doc/wp:wp/wp:listings/wp:listing/wp:displayname/text() @@ -106,7 +106,7 @@ : @return A string for the addresses associated to the phone number. : @example test/Queries/data-cleaning/conversion/address-from-phone.xq :) -declare %ann:nondeterministic function conversion:address-from-phone ( $phone-number as xs:string) as xs:string*{ +declare %an:nondeterministic function conversion:address-from-phone ( $phone-number as xs:string) as xs:string*{ let $url := concat("http://api.whitepages.com/reverse_phone/1.0/?phone=",$phone-number,";api_key=",$conversion:key) let $doc := http:get-node($url)[2] let $addresses := @@ -128,7 +128,7 @@ : @return A sequence of strings for the person or organization's names associated to the address. : @example test/Queries/data-cleaning/conversion/user-from-address.xq :) -declare %ann:nondeterministic function conversion:user-from-address ( $address as xs:string) as xs:string*{ +declare %an:nondeterministic function conversion:user-from-address ( $address as xs:string) as xs:string*{ let $tokens := tokenize ($address, ",") let $token-full-street := $tokens[position()=1] let $state := @@ -154,7 +154,7 @@ : @return A sequence of strings for the phone number or organization's names associated to the address. : @example test/Queries/data-cleaning/conversion/phone-from-address.xq :) -declare %ann:nondeterministic function conversion:phone-from-address ( $address as xs:string) as xs:string*{ +declare %an:nondeterministic function conversion:phone-from-address ( $address as xs:string) as xs:string*{ let $tokens := tokenize ($address, ",") let $token-full-street := $tokens[position()=1] let $state := @@ -191,7 +191,7 @@ : @return The value resulting from the conversion : @example test/Queries/data-cleaning/conversion/unit-convert.xq :) -declare %ann:nondeterministic function conversion:unit-convert ( $v as xs:double, $t as xs:string, $m1 as xs:string, $m2 as xs:string ) { +declare %an:nondeterministic function conversion:unit-convert ( $v as xs:double, $t as xs:string, $m1 as xs:string, $m2 as xs:string ) { if ( $m1 = $m2 ) then $v else let $conversion-table := @@ -303,7 +303,7 @@ : @return The pair of latitude and longitude coordinates associated with the input address. : @example test/Queries/data-cleaning/conversion/geocode-from-address.xq :) -declare %ann:nondeterministic function conversion:geocode-from-address ( $q as xs:string* ) as xs:double* { +declare %an:nondeterministic function conversion:geocode-from-address ( $q as xs:string* ) as xs:double* { let $id := "" let $url := "http://where.yahooapis.com/geocode?q=" let $q2 := string-join(for $i in $q return translate($i," ","+"),",") @@ -321,7 +321,7 @@ : @return The sequence of strings corresponding to the different components (e.g., street, city, country, etc.) of the place name that corresponds to the input geospatial coordinates. : @example test/Queries/data-cleaning/conversion/address-from-geocode.xq :) -declare %ann:nondeterministic function conversion:address-from-geocode ( $lat as xs:double, $lon as xs:double ) as xs:string* { +declare %an:nondeterministic function conversion:address-from-geocode ( $lat as xs:double, $lon as xs:double ) as xs:string* { let $id := "" let $url := "http://where.yahooapis.com/geocode?q=" let $q := concat($lat,",+",$lon) @@ -351,7 +351,7 @@ : @see http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html : @example test/Queries/data-cleaning/conversion/currency-convert.xq :) -declare %ann:nondeterministic function conversion:currency-convert ( $v as xs:double, $m1 as xs:string, $m2 as xs:string, $date as xs:string ) { +declare %an:nondeterministic function conversion:currency-convert ( $v as xs:double, $m1 as xs:string, $m2 as xs:string, $date as xs:string ) { let $daily := "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" let $hist := "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml" let $doc := if (string-length($date) = 0) then http:get-node($daily)[2] else === modified file 'src/com/zorba-xquery/www/modules/data-cleaning/normalization.xq' --- src/com/zorba-xquery/www/modules/data-cleaning/normalization.xq 2011-11-08 21:16:29 +0000 +++ src/com/zorba-xquery/www/modules/data-cleaning/normalization.xq 2012-04-11 10:14:19 +0000 @@ -32,7 +32,7 @@ import module namespace http = "http://www.zorba-xquery.com/modules/http-client"; -declare namespace ann = "http://www.zorba-xquery.com/annotations"; +declare namespace an = "http://www.zorba-xquery.com/annotations"; declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; declare option ver:module-version "2.0"; @@ -1191,7 +1191,7 @@ : @return A sequence of strings with the address encoded in a cannonical format, where each string in the sequence corresponds to a different component (e.g., street, city, country, etc.) of the address. : @example test/Queries/data-cleaning/normalization/normalize-address.xq :) -declare %ann:nondeterministic function normalization:normalize-address ( $addr as xs:string* ) as xs:string* { +declare %an:nondeterministic function normalization:normalize-address ( $addr as xs:string* ) as xs:string* { let $id := "" let $url := "http://where.yahooapis.com/geocode?q="
-- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp