more on problem importing 1810-1819 data

13/01/12

Permalink 01:35:46 pm, by sarneil, 330 words, 185 views   English (CA)
Categories: Activity Log; Mins. worked: 120

more on problem importing 1810-1819 data

In the _importCriminal method, this block of code:
if (isset($data->attributes()->id)) {
$xmlId = $data->attributes()->id;
} else {
$xmlId = null;
}
always returns null for $xmlId, as there are no attributes in any
instance of the criminal element in the data.

In the criminals table, there is no field named "xml_id", so any
reference to that field will throw an error.

There is one such reference in _importCriminal:
$new = array(
'surname' => $data->surname,
'given_name' => $data->given_names,
'age' => $data->age,
'gender_id_fk' => array_search(strtolower($data->gender),
$this->genderMap),
'xml_id' => $xmlId
);
$id = $this->tables['criminals']->insert($new);

and two references in one line in _syncCriminals:
$records =
Zend_Db_Table::getDefaultAdapter()->fetchPairs('SELECT criminal_id,
xml_id FROM criminals WHERE xml_id IS NOT NULL');

For the instance in _importCriminal, if I replace 'xml_id' with
'criminal_id' then the record is added to the criminals table, but of
course there is no field 'xml_id' so naturally no value for that field,
so I'm not sure if that's the desired behaviour.
For the instance in _syncCriminals, it makes no sense to simply replace
xml_id with criminal_id. I understand the logic of what syncCriminals is
supposed to do, but I don't see how that code can possibly not throw an
error. That line of code requires there be an xml_id field and a
criminal_id field in each record, but that's not the case.

Is there supposed to be an xml_id field in the criminals table? I can't
find any instance of that table which has such a field. Even if I did,
as far as I can figure, the value in that field would be NULL in every
instance. I have found no instances in the data file of a criminal element with an id attribute.

Wrote to Jamie again to see if any of this jogs his memory about the structure of the dev instance he was using.

Pingbacks:

No Pingbacks for this post yet...

Capital Trials at the Old Bailey

Simon Devereaux has approximately 10,000 records of people convicted in potentially capital cases between 1710 and 1840 in London heard at the Old Bailey court. This project will create a web-based database which will allow interested researchers and members of the public to compose queries on that data (e.g. women charged with robbery 1710-1720). It must be able to support a range of queries and produce output allowing researchers to identify trends in judicial practice over that time.

Reports

Categories

June 2013
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

XML Feeds