Massive convertion of "source language" of terms, authority records and descriptions

70 views
Skip to first unread message

virtu...@yahoo.com.br

unread,
Aug 29, 2014, 3:39:16 AM8/29/14
to ica-ato...@googlegroups.com

Dear colleagues,

I'm from Brazil and we are initiating a large archival project in Perseu Abramo Foundation (Fundação Perseu Abramo) with multiple fonds and collections, including Workers Party fonds (Partido dos Trabalhadores – the party of our former president Lula and party of president Dilma Roussef). I have a straight technical question to make. We had a few problems working with “Portuguese” as our default language and had to initiate the project using “English” for all our Portuguese contents (descriptions, authority records, terms and so on). We solved that problems and are willing to use “Portuguese” now for all our content, that is already elaborated in that language. Is there a way we can safely and massively convert all our content (descriptions, terms, authority records...) from English to Portuguese as source language, maybe manipulating the raw data in the database tables? I couldn't find any topic on this matter in the manual or the users forum.

Best regards!

Carlos Henrique Menegozzo

Head Archivist

Fundação Perseu Abramo

mi...@artefactual.com

unread,
Aug 29, 2014, 2:09:15 PM8/29/14
to ica-ato...@googlegroups.com, virtu...@yahoo.com.br
Hi Carlos,

To change culture in bulk, you can use MySQL SQL commands on database tables. Database tables containing internationalized data have names ending in "_i18n".

You'd first backup your database then enter the MySQL shell from the command-line:

  $ mysql -u <username -p<password> -h <host> -D <databasse>

To change the language code of archival descriptions you'd enter:

  mysql> UPDATE information_object_i18n SET culture='pt' WHERE culture='en';

Changing terms is a bit more involved. You first need to determine the ID of the taxonomy you wish to change.

To get the ID of  the material types taxonomy, for example, you'd enter:

  SELECT id FROM taxonomy_i18n WHERE name='Material Type' AND cultural='en';

Then, knowing the ID, you'd enter:

  UPDATE term t INNER JOIN term_i18n ti ON t.id=ti.id SET ti.culture='pt' WHERE t.taxonomy_id=<taxonomy ID> AND ti.culture='en';

After you've made modifications, you can use the command-line to re-index your search index:

  ./symfony search:populate

Cheers,
Mike

virtu...@yahoo.com.br

unread,
Aug 29, 2014, 2:45:07 PM8/29/14
to ica-ato...@googlegroups.com, virtu...@yahoo.com.br
Thank you very much Mike! Two additional questions: 1) These commands will change the culture for the authority records as well (i imagine their are been considered as "descriptions" in your comments)? 2) Executing these command will automatically eliminate all data on "English" culture (eliminating them are our objective)? Thanks again. Cheers

mi...@artefactual.com

unread,
Aug 29, 2014, 7:05:44 PM8/29/14
to ica-ato...@googlegroups.com, virtu...@yahoo.com.br
Hi Carlos,

To update authority records you can enter the following command into MySQL:

  UPDATE actor a inner join actor_i18n ai on a.id=ai.id SET ai.culture='pt' WHERE ai.culture='en';

These commands should eliminate the "English" culture for these types of data.

Cheers,
Mike

David Juhasz

unread,
Aug 29, 2014, 7:11:29 PM8/29/14
to ica-ato...@googlegroups.com
Carlos,

To complete the switch from English to Portuguese you will probably need to update the "source_culture" columns for each entity as well:

  mysql> UPDATE information_object SET source_culture='pt' WHERE source_culture='en';

  mysql> UPDATE actor SET source_culture='pt' WHERE source_culture='en';

  mysql> UPDATE term SET source_culture='pt' WHERE taxonomy_id=<taxonomy ID> AND source_culture='en';


Cheers,
David

--

David Juhasz
Director, AtoM Technical Services Artefactual Systems Inc. www.artefactual.com


--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at http://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/f74c77a1-824d-49a8-bf1b-66b8e7ddb2a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Gillean

unread,
Aug 29, 2014, 7:23:24 PM8/29/14
to ica-ato...@googlegroups.com
Carlos,

One last point, to save you a bit of time on Mike's first step with updating the terms in the Material type taxonomy. You can see the Taxonomy ID's by looking at this page in our GitHub repo - they are constants. It looks like the Material Type taxonomy ID is 50:

https://github.com/artefactual/atom/blob/qa/2.1.x/lib/model/QubitTaxonomy.php#L42

Cheers,

Dan Gillean, MAS, MLIS
AtoM Product Manager / Systems Analyst,
Artefactual Systems, Inc.
604-527-2056
@accesstomemory


virtu...@yahoo.com.br

unread,
Sep 16, 2014, 10:57:12 PM9/16/14
to ica-ato...@googlegroups.com
Hi everyone. Thanks for your help!
We will run all command lines and post the results in the next weeks.
cheers!
Reply all
Reply to author
Forward
0 new messages