Skip to content
David Thompson edited this page Jul 30, 2016 · 3 revisions

Memorial

Created Saturday 30 July 2016

Other links

http://www.28maoribattalion.org.nz/

Notes

Setup

  • Ubuntu 14.04 c1.c1r2
  • Installed: (see also: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu )
    • apache2
      • apt-get install lib-apache2-mod-php5
      • sudo a2enmod rewrite
      • sudo a2enmod headers
    • sudo service apache2 restart
      • Add index.php to /etc/apache2/mods-enabled/dir.conf
    • mysql-server-5.6 - utfm8mb4 config needed in /etc/mysql/my.cnf
      • CREATE DATABASE nzmemorials;
      • GRANT ALL on nzmemorials.* TO 'nzmemorials@localhost' IDENTIFIED BY '$PASSWORD';
      • FLUSH privileges;
      • [relog with nzmemorials user]
      • SHOW GLOBAL VARIABLES LIKE 'innodb_fil%';
      • SHOW GLOBAL VARIABLES LIKE 'innodb_lar%';
      • USE nzmemorials;
      • CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
    • git
    • drush
    • php5-mcrypt
    • php5-curl
    • php5-gd
  • Drupal 7.50 install: uid1 blocked; use other administrator accts.
  • drush en -y rest_server - https://www.drupal.org/documentation/modules/services
  • drush ev "variable_set('drupal_all_databases_are_utf8mb4',TRUE)"
  • drush dis toolbar overlay
  • drush en -y admin_menu admin_menu_toolbar
  • drush en -y migrate migrate_ui querypath
  • drush en -y memorial memorialapi
  • drush vset memorials_xml_folder $XML_FOLDER (or whatever else)

API Notes

Fields useful for for identifying a person:

  • am_givenName->am_fullName [L F M]
    • "Lewin Ernest Herbert"
  • am_givenName->foaf_familyName [L]
    • "Lewin"
  • am_givenName->foaf_firstName [F M]
    • "Ernest Herbert"
  • am_givenName->foaf_name, dc_title
    • "Ernest Herbert Lewin"
  • am_ingoa [ Māori name? ]

http://api.aucklandmuseum.com/v1/search/cenotaph/am:MilitaryPerson/_search?api_key=[...]&q=am_givenName.foaf_familyName:Lewin+AND+am_givenName.foaf_firstName:Ernest+H

  • am_serviceNumber->rdf_value, dc_identifier

    • "2/2861"
  • am_birth->am_birthNotes

    • "Whangarei, New Zealand"
  • am_birth->am_placeOfBirth

    • "Whangarei/Northland/New Zealand"
  • ecrm_P138_has_representation->amMediaLocation: [ filepath ]

    • "Cenotaph\nomroll\NZEF02_0026_0021.jpg"
  • ecrm_P138_has_representation_0

    • "am:vernon/av/321257"
  • am_displaynotes, dc_description

    • "Ernest Lewin was the son of James and Martha Lewin. Native of England."
  • am_enlistment->am_conflict, am_discharge->am_conflict

    • "WW1"
  • am_cemetery->am_restingPlace (+am_graveReference?)

    • Lijssenthoek Military Cemetery, Poperinge, West-Vlaanderen, Belgium
  • am_death->am_ageAtDeath

    • 27
  • am_death->am_dateOfDeath

    • 9 Jan 1918
  • am_death->am_placeOfDeath

    • France
  • am_discharge->am_rankLastHeld->rdf_value

    • Gunner
  • am_discharge->am_unitLast->rdf_value

    • New Zealand Field Artillery
  • am_enlistment->am_JobAtEnlistment->rdf_value

    • Coach Builder
  • am_force

    • Army
  • am_nextOfKinAtEmbarkation->am_nextOfKin

    • "Mrs James Lewin (mother), Lyttelton, New Zealand"
  • am_nextOfKinAtEmbarkation->am_nextOfKinLocation

    • "Lyttelton/Christchurch/Canterbury/New Zealand"

Attempt multi_match query:

http://api.aucklandmuseum.com/v1/search/cenotaph/am:MilitaryPerson/_search?api_key=$APIKEY
{
  "multi_match" : {
    "query":      "Lewin Ernest H",
    "type":       "best_fields",
    "fields":     [ "am_givenName.foaf_name", "dc_title"],
    "tie_breaker": 0.3
  }
}

Test People

Lewin Ernest H -> 1 result is am:person/C8740 -> "Lewin Ernest Herbert"

http://api.aucklandmuseum.com/v1/search/cenotaph/am:MilitaryPerson/_search?api_key=$API_KEY&fields=am_givenName.am_fullName,am_givenName.foaf_firstName,am_givenName.foaf_familyName,am_displayNotes,am_discharge.am_conflict,am_discharge.am_rankLastHeld.rdf_value,am_discharge.am_unitLast.rdf_value,am_death.am_dateOfDeath,am_death.am_placeOfDeath&q=(am_givenName.foaf_familyName:Lewin AND am_givenName.foaf_firstName:Ernest H)

Result:

{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 6.9849358,
    "hits": [
      {
        "_index": "cenotaph-2015-12-29-1",
        "_type": "am:MilitaryPerson",
        "_id": "am:person/C8740",
        "_score": 6.9849358,
        "fields": {
          "am_givenName.foaf_firstName": [
            "Ernest Herbert"
          ],
          "am_discharge.am_rankLastHeld.rdf_value": [
            "Gunner"
          ],
          "am_death.am_placeOfDeath": [
            "France"
          ],
          "am_displayNotes": [
            "Ernest Lewin was the son of James and Martha Lewin. Native of England."
          ],
          "am_discharge.am_conflict": [
            "WW1"
          ],
          "am_givenName.am_fullName": [
            "Lewin Ernest Herbert"
          ],
          "am_discharge.am_unitLast.rdf_value": [
            "New Zealand Field Artillery"
          ],
          "am_givenName.foaf_familyName": [
            "Lewin"
          ],
          "am_death.am_dateOfDeath": [
            "09 Jan 1918"
          ]
        }
      }
    ]
  }
}

Moore John R

  • 43 results
    • displayNotes:
      • Son of Robert and Ellen, NE Valley, Dunedin
      • Son of Thomas and Helen, Sumner, Christchurch; husband of Mary, Kaiapoi
http://api.aucklandmuseum.com/v1/search/cenotaph/am:MilitaryPerson/_search?api_key=$APIKEY&fields=am_givenName.foaf_fullName,am_givenName.foaf_firstName,am_givenName.foaf_familyName,am_displayNotes&q=am_givenName.foaf_familyName:Moore+AND+am_givenName.foaf_firstName:John

Potential typo:

  • am:person/C128171 -> Frederick John Selywn Moore" (Possibly Selwyn?)

ElasticSearch has trouble with spaces in phrases like "John R". Damnit.

Todo

  • Auckland museum API: find best way to query for names
  • View to do a simple map, table to list all our memorials.
Clone this wiki locally