[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[UDD] Splitting email phrase and address in bugs.submitter ?



Hi.

(still not subscribed as interested mostly only in UDD at the moment, so
please CC-me of responses).

In order to test the UDD to RDF export already described, I have had to
split email addresses components in bugs.submitter in order to be able
to extract various components of a foaf:Person, i.e. foaf.name and
foaf.mbox.

I've done that by adding mail-splitting plperl functions to postgres,
used in a view :

# this is needed for use of Email::Address in plperl
$ createlang plperlu UDD

CREATE FUNCTION email_phrase (text) RETURNS text AS $$
use  Email::Address;
my $value = $_[0];
my $address = ( Email::Address->parse($value) )[0];
if ($address) {
return $address->phrase;
} else {return '';};
$$ LANGUAGE plperlu;

CREATE FUNCTION email_address (text) RETURNS text AS $$
use  Email::Address;
my $value = $_[0];
my $address = ( Email::Address->parse($value) )[0];
if ($address) {
return $address->address;
} else {return '';};
$$ LANGUAGE plperlu;

Then :
CREATE VIEW d2r_bugsubmitter AS
SELECT DISTINCT bugs.submitter, email_phrase(bugs.submitter), email_address(bugs.submitter)   FROM bugs

Maybe this could be tuned so that such calculations are cached as the
functions results are constant, but at the moment it runs really slow,
and considering there are > 20000 bug reporters in UDD... it's not
really efficient.

I'm no postgres expert, and maybe there would be better ways to do
that... but obviously there's at least the possibility to do it as early
as possible, i.e. during UDD bugs table filling.

Do you think that such a change might be done on UDD ?

Maybe also linking to the carnivore-related tables for bug reporters who
are alread present in carnivore also, then (once the email is splitted
apart) ?

Comments ?

Regards,
-- 
Olivier BERGER <olivier.berger@it-sudparis.eu>
http://www-public.it-sudparis.eu/~berger_o/ - OpenPGP-Id: 1024D/6B829EEC
Ingénieur Recherche - Dept INF
Institut TELECOM, SudParis (http://www.it-sudparis.eu/), Evry (France)


Reply to: