Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cultural Heritage Dates in Ruby

891 views

Published on

I’ve got 99 problems, and they’re all dates.

Art Tracks is a project for the Carnegie Museum of Art, tracking the history of ownership for fine art. As part of this, we’ve had to deal with date problems unlike those of most technology projects—problems such as dates like “sometime after 1995” and “Possibly the fifteenth century” .

Ruby and the date_time_precision gem have been an invaluable tool in helping to maintain and manipulate the very specific information contained in these historical records.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Cultural Heritage Dates in Ruby

  1. 1. Cultural Heritage Dates Understanding the provenance of an artwork. David Newbury @workergnome
  2. 2. What is Art Tracks? Art Tracks is a research project at the Carnegie Museum of Art.
  3. 3. What is Art Tracks? Art Tracks is a research project at the Carnegie Museum of Art. We're digitizing the history of ownership of art.
  4. 4. Oldest item Vase MESOPOTAMIAN, SUSA (C. 3000 BCE-2000 BCE) painted earthenware Walter Read Hovey Collection
  5. 5. Newest item My Heart Is Not Here My Heart's in The Highlands Chasing The Deers Rokni Haerizadeh (2013) gesso, ink, and watercolor on printed paper The Henry L. Hillman Fund
  6. 6. Museums are full of art. Art is culture. Art is also stuff.
  7. 7. Stuff has a history. — Created by an artist — Sold to collectors — Given to children — Sold at auctions Eventually, it ends up at a museum.
  8. 8. The record of this is called Provenance.
  9. 9. Provenance is a chain of ownership. Every time a painting changes hands, it's a new link in that chain.
  10. 10. Water Lilies (Nymphéas) Claude Oscar Monet [1840-1926]; Estate of Claude Oscar Monet; Michel Monet, son of the artist, Sorel Moussel, Dept. Eure et Loire, 1926 until 1950; Walter P. Chrysler, Jr. [1908-1988], New York, NY, 1950 until 1962; purchased by Museum, April 1962.
  11. 11. What Data?
  12. 12. The Person Name Birth Death Location Portrait of Isabella de' Cosimo I de Medici C. 1570-1574 Alessandro Allori oil on canvas (transferred from panel) Gift of Mrs. Paul B. Ernst
  13. 13. The Transfer Acquisition Method Direct Transfer Auction Harry Shokler 1942 silkscreen on paper Leisser Art Fund
  14. 14. Metadata Stock numbers Footnotes Primary ownership Footed bowl C. 1925 OTTO LINDIG (GERMAN, 1895–1966) earthenware Gift of Barry Friedman, Ltd.
  15. 15. Dates Acquisition Deacquisition Persimmon (Kaki) MAKI HAKU (JAPANESE, 1924–2000) woodcut with embossing on paper Bequest of Dr. James B. Austin
  16. 16. Dates are not a thing A date is a string representation of a particular moment of time. ...At a particular location. ...On earth.
  17. 17. Easy Date Problems: 12/4/2014: December 4th or April 12th? Depends on your national standard. Don't do this. ISO 8601 is what you want. 2014-12-04T00:00:00
  18. 18. Medium Date Problems: 2014-12-04T00:00:00: December 4th or December 3rd? Depends on your location. Use UTC. Time zones matter. 2014-12-04T00:00:00Z
  19. 19. Hard Date Problems: October 6th, 1582 Exists in England. Doesn't exist in Italy. Date.new(1582,10,5) # ArgumentError: invalid date Date.new(1582,10,14,Date::ENGLAND) # <Date: 1582-10-14 ((2299170j,0s,0n),+0s,2361222j)> fantastic trolling opportunity here for tests.
  20. 20. Harder Date Problems: What year comes before 1 AD? — 0 AD? — 1 BCE? St. George and the Dragon YUGOSLAVIAN C. 1500 oil on panel Gift of Dr. Walter Read Hovey
  21. 21. Choosing an Epoch
  22. 22. Unix Time Seconds since 0h Jan 1, 1970 DateTime.new(2014,12,4,20,0,0).to_time.to_i # => 1417723200 Valid between December 13, 1901 and 19 January 2038.
  23. 23. Gregorian The way you learned dates in school valid since Oct 15, 1582 DateTime.new(2014,12,4,20,0,0).to_s # => "2014-12-04T20:00:00+00:00"
  24. 24. Julian Day The way Ruby represents dates days since 12h Jan 1, 4713 BC DateTime.new(2014,12,4,20,0,0).jd # => 2456996
  25. 25. Heliocentric Julian Day The current day. On the sun.
  26. 26. Barycentric Julian Day The current day. At the center of the solar system.
  27. 27. Dates in Ruby Mug TOBIAS BAUER (GERMAN) 1695-1705 blown, gold-ruby glass w/silver-gilt mounts DuPuy Fund
  28. 28. Time — Based on (and implemented in) C — Counts seconds from Unix Epoch — Compatible with Unix and other languages — Fast
  29. 29. Date && DateTime — Written in Ruby — Counts days from Julian Epoch — Slower
  30. 30. Internal Implementation if you #inspect a DateTime: DateTime.new(2014,12,4,20,0,0).inspect # <DateTime: 2014-12-04T20:00:00+00:00 ((2456996j,72000s,0n),+0s,2299161j)>
  31. 31. DateTime: 2014-12-04T20:00:00+00:00 ((2456996j,72000s,0n),+0s,2299161j) 2014-12-04T20:00:00+00:00 the current time in ISO 8601.
  32. 32. DateTime: 2014-12-04T20:00:00+00:00 ((2456996j,72000s,0n),+0s,2299161j) 2456996j The number of days since the Julian Epoch + 72000s some number of seconds + 0n some number of nanoseconds
  33. 33. DateTime: 2014-12-04T20:00:00+00:00 ((2456996j,72000s,0n), +0s ,2299161j) +0s The offset in seconds from UTC time
  34. 34. DateTime: 2014-12-04T20:00:00+00:00 ((2456996j,72000s,0n),+0s, 2299161j ) 2299161j The day of the Gregorian Reform.
  35. 35. Imprecise Data. Computers hate imprecision. Apr. 27, 1978 ON KAWARA (JAPANESE, 1932–2014) 1978 Liquitex on canvas A. W. Mellon Acquisition Endowment Fund and Carnegie International Acquisition Fund
  36. 36. Precision — January 1, 1900 — January 1900 — 1900 — the 1900s — the 20th Century What is the difference?
  37. 37. date_time_precision gem https://github.com/Spokeo/date_time_precision Extends Ruby Date, Time, and DateTime to include the notion of date precision.
  38. 38. require 'date_time_precision year = DateTime.new(1990) => #<DateTime: 1990-01-01T00:00:00+00:00 ((2447893j,0s,0n),+0s,2299161j)> year.precision => 1 # or DateTimePrecision::YEAR year.day? => false year.year? => true
  39. 39. Persists via copy new_year = year => #<DateTime: 1990-01-01T00:00:00+00:00 ((2447893j,0s,0n),+0s,2299161j)> new_year.precision => 1
  40. 40. Needed to handle DECADE && CENTURY precision year = DateTime.new(1755) year.decade => 1750 century = year century.precision = DateTimePrecision::CENTURY year.century => 1700
  41. 41. Custom Extensions for Date#earliest && Date#latest year = Date.new(1755) year.earliest => Wed, 01 Jan 1755 year.latest => Wed, 31 Dec 1755 century = Date.new(1800) century.precision = DateTimePrecision::CENTURY century.earliest => Wed, 01 Jan 1800 century.latest => Sun, 31 Dec 1899
  42. 42. Ontologies Modeling the data.
  43. 43. ... What is the CIDOC CRM The CIDOC Conceptual Reference Model (CRM) provides definitions and a formal structure for describing the implicit and explicit concepts and relationships used in cultural heritage documentation. — http://www.cidoc-crm.org
  44. 44. A Timeline represents the entire history of ownership of a single work.
  45. 45. A Period is a single period in time representing an single owner of a work.
  46. 46. Beginnings & Endings
  47. 47. George, 1950; Mary 1965.
  48. 48. George, by 1960 until sometime after 1962; Mary, in 1970.
  49. 49. John Doe, 1995
  50. 50. John Doe, by 1995
  51. 51. John Doe, after 1995
  52. 52. John Doe, until 1995
  53. 53. John Doe, until at least 1995
  54. 54. John Doe, until sometime before 1995
  55. 55. John Doe, in 1960
  56. 56. John Doe, 1950 until 2000
  57. 57. require 'museum_provenance' text = "sold December 1936 to Robert Doe, Pittsburgh" period = MuseumProvenance::Period.new() puts period.parse_time_string(text) # => sold to Robert Doe, Pittsburgh puts period.beginning.to_s # => December 1936 puts period.beginning.earliest # => 1936-12-01 puts period.beginning.latest # => 1936-12-31 puts period.ending.to_s # => nil
  58. 58. Why all this work?
  59. 59. Nazi War Crimes.
  60. 60. Thank You. https://github.com/cmoa/museum_provenance David Newbury @workergnome

×