Monthly Archives: December 2012

Winter Break @CulturePlex

Well it’s already the 20th of December, classes have been over for two weeks and things are a bit more relaxed around here at Western. Campus is strangely deserted and it’s hard to get that 4 p.m. cup of coffee that you know every grad student requires for survival. Everyone is closing up shop, mopping the floor and stepping out early. It’s that time of year.

What is dbrownbeta doing for vacations…drinking margaritas in Cabo…or perhaps a bit of SCUBA in Roatán—maybe mounting a quick roadtrip to Utah?

Not this year folks. Just sitting tight in Canada waiting for the snow.

I am taking advantage of this time to get a few things done. When school is in session it’s tough to get much real work done with the nonstop itinerary of classes and meetings and readings and speakers. Your job is grad school and grad school is your life. Does that make sense? So your job is really to live your life of a grad student. Confusing? Yes it confuses me as well.

Moving on to more technical and less ridiculous topics, I want to talk a bit about what I am doing this Winter Break. Let’s do this.

Finishing Up My CourseWork

Last weekend I finished my project for the class the Máquina cultural. Although the essay wasn’t my finest work, the models I made turned out quite nicely, and I got a chance to experiment with Gephi’s Geo Layout. And I got to add a new function to my Gephi/Python library.

The graph consisted of the metadata of a corpus of literary and critical texts laid out in Gephi. The majority of nodes were just standard nodes with normal attributes, however, the nodes that represented geographical locations (cities) were arranged based on their lat/long attributes using Gephi’s Geo Layout.

These geonodes were then fixed in place using my new fix_set function in combination with other functions from the Gephi/Python library. Then the other nodes were arranged around the geonodes using ForceAtlas 2.

Pretty neat huh?

CulturePlex Projects

I am also working on a few CulturePlex projects this Winter Break. I recently received the chance to help out with the Sylva project. The lab is getting ready to officially release Sylva to the public, and because one of the priorities of Sylva is ease of use, we want to provide comprehensive documentation. I am helping to develop the content of this documentation. We are working on creating three types of documentation: a user guide that describes all of the features of Sylva, a step by step tutorial to creating your first graph with Sylva, and a help menu with FAQs, solutions, etc.

We are also beginning work on a new period of the Preliminaries project. In this phase we will focus on the time period of 1643-1661 during the administration of Luis de Haro. We are particularly interested in this period because this is when Pedro Calderón de la Barca began to be published prolifically. In this case, the graph will be used not only for general network analysis, but also as a supplement to studies on the contemporary reception of Calderón’s work. We have just barely begun to assemble the first editions list for this phase, but we plan to have it finished before May.

Personal Projects

I have three personal projects this winter break: learn HTML/CSS, learn JavaScript for use in web pages and the Google Maps API, and build a personal web page. I started learning HTML last Sunday evening, and my colleague Roberto showed me on the Bootstrap on Wednesday. Bit by bit, my website is coming along:


It’s called xitōmatl and it will provide links to my social networking sites, descriptions of my projects (personal and CulturePlex) with their associated image galleries, my personal profile and CV, etc. Also, I plan on creating a page that focuses specifically on the research of New Spain. Here I will provide a variety of content supplemented with links to digitized rare New Spanish books, various websites useful in the study of New Spain, and a few resources for learning Classical Nahuatl (another project coming soon). xitōmatl is available at this Gist if you want to take a look. It’s still a bit sloppy (a bunch of style elements that need to be is a CSS), but you get the idea.

That’s it for today…time to get back to work.

Happy Holidays




Leave a Comment

Filed under Uncategorized

Preliminaries Project: A Gephi/Python Library

This week I would like to present a short report that describes the Gephi/Python library I have been slowly developing over the past two months. All the code is available at this gist, please try it, use it, or even better, contribute!


Preliminaries is a CulturePlex Laboratory project that focuses on social network analysis of Early Modern Spanish literature. Starting in Summer 2012, we have been collecting extensive bibliographic information from the preliminaries section of these texts and storing it in Sylva, a graph database also designed at the CulturePlex. This information is then visualized as a graph using Gephi. The Python scripts presented here were developed to be run in Gephi’s Python scripting console in response to a need for efficient access to information in the graph, to modify the graph, and to perform statistics operations not included in the Gephi application. The following is brief explanation of each function included in the mini-library and an example of its use.

The Preliminaries graph sized for betweenness centrality:

A Gephi/Python Library

1. find_neighbors(degree_sep,node)

This function finds all neighbors of any node in the graph to n-degrees of separation. Gephi includes an ego network filter that extends to 3 degrees of separation. We needed to find ego networks to 4 or more degrees. Also, I just fixed the recursive version of this function (thanks versae)!

Here I will filter the visible graph to find the neighbors of Miguel de Cervantes to 4 degrees:

2.  color_set(set,color)

Since I can’t create a subgraph with this function, I wrote another function to control a set of nodes color to mark subsets visually on the graph.

3.  size_set(set,size)

And yet another to size the nodes.







Miguel de Cervantes neighbors colored red and sized at 20:


4.  filter_by_type(set_to_be_filtered,nodetype)

If I am only concerned with a certain type of node (text, person, etc), I can filter for type using the following function.

‘Persona’s in the Cervantes subset:

5. return_label(set)

 Node IDs don’t tell me much, what if I want to see the labels of these nodes?








Labels of the ‘Persona’s:

6.  set_intersect(set1,set2)

 Finally, if I am comparing two subsets of a graph, I can see what nodes they have in common.






Set intersect of Miguel de Cervantes and El Inca Garcilaso:



Leave a Comment

Filed under Uncategorized