Hello all

I'm building a data integration system for three patient databases: one in
Oracle, other in Interbase, other in MySQL.

Each one identifies the same patient by a somewhat different ID, so we wrote
a Java function that maps all IDs to a new, unified, code (let's call it the
unified id, and the others the local ids).

The perfect situation would be to get the unified id directly from the
database, so I would unify all patient data with it. However

- The function is pretty extensive and I would like to avoid to reimplement
it on the different dialects of SQL above;

- I don't control 2 of the 3 databases, so I can't easily add some library
that allows the database to access the Java function (and I don't even know
if there is such thing! for mysql, afaik*, is no picnic);


Alternative 1) So, is there a way I can refer to this function in the
mapping file, like:

map_xunfa:Conversor a d2rq:ClassMap;
        d2rq:dataStorage  map_xunfa:database;
        d2rq:uriPattern "Patient/@@br.accamargo.my_function(
PACIENTE.LOCAL_ID )@@";
        d2rq:class vocab:Patient;
        .


Alternative 2) I would map the results of the function into a class. Imagine
that I produce a table with static contents produced by the function:

Unique_id   local_id_1    local_id_2   local_id_3
99999999   9                 2828123      42341235
...

when in fact my_function_1(local_id_1 ) = my_function_2(local_id_2 )  =
my_function_3(local_id_3 ) = unique_id.

Then I could map each patient to the same class *Patient*, but would rely on
SPARQL to integrate information, like

SELECT * WHERE
{
   ?patient a vocab:Patient.
   ?unique_id vocab:mapsToLocalId ?local_id.
    FILTER (
            ?unique_id = 9999999
    )

}

Or something.

I could create a table with all possible values, but then I would have to
keep it up-to-date, as the databases are live. So it's possible to perform
such a mapping from a function, instead of a database table?


Thanks!

dfcp




*http://planet.mysql.com/entry/?id=13420

Diogo F.C. PatrĂ£o
Manager of Medical Informatics
Biotechnology Laboratory
Hospital A.C. Camargo
http://www.accamargo.org.br/
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to