Specification

DiaryObservation

Represents an observation.
DiaryObservation[<|​​"Type"_String(*Thetypeofobservation(RelativePosition,WindDirection,etc)*),​​"Content"<|...|>(*Thecontentoftheobservation*),​​"Date"DiaryCombinedDate[...],​​"UUID"_String(*UUIDforidentifyingthisobservation*),​​"Provenance"<|​​"Creator"_String(*Creatorname*),​​"TabletID"_String(*OraccID(forexample,X301440)*),​​"LineNumber"_Integer(*ThelinenumberinthereferencecopoyofOracc*),​​"Reviewed"True|False(*Whetherthisobservationreviewed*),​​"Notes"_String|_Missing(*Anynotesabouttheprovenance*)​​|>​​|>]

Observation types

General astronomical

RelativePosition

Represents the relative position of two objects, as usually written in the main body of each month.
<|​​"Object"_Entity|_Missing(*Primaryobject*),​​"Reference"_Entity|_Missing(*Secondaryobject*),​​"Displacements"{​​{_DiaryDistance|_Missing,"InFrontOf"|"Behind"|"East"|"West"|"Above"|"Below"|"North"|"South"|_Missing}(*Firstdisplacementmentioned*),​​{_DiaryDistance|_Missing,"InFrontOf"|"Behind"|"East"|"West"|"Above"|"Below"|"North"|"South"|_Missing}(*Seconddisplacementmentioned*)}​​|>

ZodiacalPosition

Represents an observation that an object was in a sign of the zodiac. This should be used for end of month summaries as well as for things like first appearances.
<|​​"Object"_Entity|_Missing,​​"Sign"_Entity|_Missing,​​"Entering"True|False(*whetherthisisthefirstdaywhenthisobjectentered("reached")thissign*),​​"PositionInSign""Beginning"|"End"|_Missing​​|>

NamedPosition

Represents an observation that an object was in some named region in the sky. For example, “Mars became stationary in the area of the Lip of the Scorpion”.
<|​​"Object"_Entity|_Missing,​​"Name"_String​​|>

Visible

Represents a note that an object was visible. This is common in eclipse reports.
<|​​"Object"_Entity|_Missing​​|>

NotVisible

Represents a note that an object was not visible. This is common in end of month summaries when the sign of the zodiac would otherwise be recorded, as well as in eclipse observations.
<|​​"Object"_Entity|_Missing​​|>

Solstice

Represents a solstice. These were likely predicted for most of the diaries.
<|​​"IdealDate"_DiaryBabylonianDate|_Missing,​​"DidNotWatch"True|False​​|>

Equinox

Represents an equinox. These were likely predicted for most of the diaries.
<|​​"IdealDate"_DiaryBabylonianDate|_Missing,​​"DidNotWatch"True|False​​|>

Eclipse

Represents an observation of an eclipse.
<|​​"EclipseType""Lunar"|"Solar",​​"Observed"True|False(*Whethertheeclipsewasobservedorpredicted*),​​"MoonriseToSunset"_String|_Missing(*Subobservation*),​​"SunriseToMoonset"_String|_Missing(*Subobservation*),​​"StartTime"_DiaryCulminatingTime|_Missing,​​"EntranceDirection""North"|"South"|"East"|"West"|"Northeast"|"Northwest"|...|_Missing,​​"StartToMaxPhase"_DiaryDuration|_Missing,​​"MaxPhase"{_DiaryDistance|_Missing,"Magnitude"|"Remaining"(*Whetherthemagnitudewas4fingers,ortherewere4fingersremainingtototality*)}|"Total"|_Missing,​​"MaxPhaseDuration"_DiaryDuration|_Missing,​​"MaxPhaseToEnd"_DiaryDuration|_Missing(*Timebetweenendofmaxphaseandeclipse*),​​"MovementDirection""North"|"South"|"East"|"West"|"Northeast"|"Northwest"|...|_Missing,​​"TotalDuration"_DiaryDuration|_Missing,​​"Weather"{_String...}(*Weatherrelatedsubobservations*),​​"ObjectVisibilities"{_String...}(*VisibleandNotVisiblesubobservations*),​​"LunarPosition"_String|_Missing(*SubobservationoftherelativepositionoftheMoon*),​​"SunsetToStart"_DiaryDuration|_Missing,​​"StartToSunrise"_DiaryDuration|_Missing​​|>

Planetary (“Greek-Letter”) phenomena

FirstAppearenceEast (Γ)

Records the first appearance of an inner planet in the east. Also used for the first visibility of outer planets.
<|​​"Object"_Entity|_Missing,​​"VisibilityDuration"_DiaryDuration|_Missing,​​"DidNotWatch"True|False,​​"IdealDate"_DiaryBabylonianDate|_Missing,​​"Position"_String|_Missing(*Subobservationofposition*)​​|>

FirstAppearenceWest (Ξ)

Records the first appearance of an inner planet in the west.
<|​​"Object"_Entity|_Missing,​​"VisibilityDuration"_DiaryDuration|_Missing,​​"DidNotWatch"True|False,​​"IdealDate"_DiaryBabylonianDate|_Missing,​​"Position"_String|_Missing(*Subobservationofposition*)​​|>

LastAppearenceEast (Σ)

Records the last appearance of an inner planet in the east.
<|​​"Object"_Entity|_Missing,​​"VisibilityDuration"_DiaryDuration|_Missing,​​"DidNotWatch"True|False,​​"IdealDate"_DiaryBabylonianDate|_Missing,​​"Position"_String|_Missing(*Subobservationofposition*)​​|>

LastAppearenceWest (Ω)

Records the last appearance of an inner planet in the west. Also used for last visibility for outer planets.
<|​​"Object"_Entity|_Missing,​​"VisibilityDuration"_DiaryDuration|_Missing,​​"DidNotWatch"True|False,​​"IdealDate"_DiaryBabylonianDate|_Missing,​​"Position"_String|_Missing(*Subobservationofposition*)​​|>

FirstStationaryPoint (Φ)

Records the first station of an inner planet or outer planet. This is often called the stationary point “in the east” for inner planets.
<|​​"Object"_Entity|_Missing,​​"DidNotWatch"True|False,​​"IdealDate"_DiaryBabylonianDate|_Missing,​​"Position"_String|_Missing(*Subobservationofposition*)​​|>

SecondStationaryPoint (Ψ)

Records the second station of an inner planet or outer planet. This is often called the stationary point “in the west” for inner planets.
<|​​"Object"_Entity|_Missing,​​"DidNotWatch"True|False,​​"IdealDate"_DiaryBabylonianDate|_Missing,​​"Position"_String|_Missing(*Subobservationofposition*)​​|>

AcronychlRising (Θ)

Records the acronychal rising of an outer planet. This is often referred to as “opposition” in translations.
<|​​"Object"_Entity|_Missing,​​"DidNotWatch"True|False,​​"IdealDate"_DiaryBabylonianDate|_Missing​​|>

Lunar Six

SunsetToMoonset

The duration between sunset to moonset recorded at the beginning of the month.
<|​​"Duration"DiaryDuration[...]|_Missing,​​"DidNotWatch"True|False,​​"Measured"True|False​​|>

MoonsetToSunrise

The duration between moonset and sunrise.
<|​​"Duration"DiaryDuration[...]|_Missing,​​"DidNotWatch"True|False,​​"Measured"True|False​​|>

SunriseToMoonset

The duration between sunrise and moonset.
<|​​"Duration"DiaryDuration[...]|_Missing,​​"DidNotWatch"True|False,​​"Measured"True|False​​|>

MoonriseToSunset

The duration between moonrise and sunset.
<|​​"Duration"DiaryDuration[...]|_Missing,​​"DidNotWatch"True|False,​​"Measured"True|False​​|>

SunsetToMoonrise

The duration between sunset and moonrise.
<|​​"Duration"DiaryDuration[...]|_Missing,​​"DidNotWatch"True|False,​​"Measured"True|False​​|>

MoonriseToSunrise

The duration between moonrise and sunrise recorded at the end of the month.
<|​​"Duration"DiaryDuration[...]|_Missing,​​"DidNotWatch"True|False,​​"Measured"True|False​​|>

Weather

WindDirection

Represents an observation that “the __ wind blew”. See the Weather observation type for things like “gusty wind blew”.
<|​​"Direction"{"North"|"South"|"East"|"West"|_Missing}​​|>

Weather

Represents generalized weather.
Note: better tags could likely be made with heavier reference to the original Akkadian terms.
<|​​"Tag""Mist"|"Rain"|"Clouds"|"ThinClouds"|"CrossingClouds"|"HeavyClouds"|"Fog"|"HeavyFog"|"Lightning"|"Thunder"|"Haze"|"Mud"|"ThickRain"|"Hail"|"Dew"|"Cloudburst"|"Cold"|"ColdWind"|"Overcast"|"Locusts"|{"Rainbow","North"|"South"|"East"|"West"|_Missing}|{"Halo","North"|"South"|"East"|"West"|_Missing}​​|>

Miscellaneous

MarketRates

Represents the prices of various commodities mentioned in the end of month summaries. The quantity of each commodity is the amount that can be bought for 1 shekel of silver. This is essentially the reciprocal of the price.
Note: these keys rely on the translations from Sachs and Hunger. They note that the translations for “Cress” and “Mustard” are uncertain.
<|​​"Barley"_DiaryCapacity|_Missing,​​"Dates"_DiaryCapacity|_Missing,​​"Mustard"_DiaryCapacity|_Missing,​​"Cress"_DiaryCapacity|_Missing,​​"Sesame"_DiaryCapacity|_Missing,​​"Wool"_Integer|_Rational|_Missing(*Weightinminas(approximatelypounds)*)​​|>
The following is used to mark when sales were “cut off”:
Missing["SalesCutOff"]

RiverLevelDirection

Represents an observation that the river level was rising, falling, or standing still on a particular day.
<|​​"Direction""Rising"|"Falling"|"Standing"|_Missing,​​|>

RiverLevelChange

Represents an observation that the river level changed from one day to another. Reported on the end date of the interval.
<|​​"StartDate"_DiaryCombinedDate|_Missing,​​"Direction""Rising"|"Falling"|"Standing"|_Missing,​​"Distance"_DiaryDistance|_Missing,​​"Remainder"_DiaryDistance|_Missing​​|>

RiverLevel

Represents an observation of the absolute river level on the na-gauge. Each unit on the na is equivalent to 4 fingers or
1/6
cubits.
<|​​"Value"_Integer|_Rational|_Missing(*Valueonthena-gauge*)​​|>

HistoricalEvent

Represents a historical event, often mentioned at the end of the month.
<|​​"EndLine"_Integer,(*thelastlinecontainingthisevent(fortextextraction)*)​​"Tags"{"War"|"ReligiousCeremony"|"Famine"|"Celebration"..}(*INCOMPLETE*)​​|>

Error

Represents an error in the original diaries. For example, when the wrong day is written, or when they write “west” instead “south”, etc. These are often errors which make it so that it is impossible to encode observations because they do not follow the standard structure.
<|​​"Type"String(*Typeofobservationbeingattempted*),​​"Note"String​​|>

Other

Represents a observation that does not fit in the current version of the format. These can be tagged so if the format is updated to support these observations, it will be possible to go back and find them.
<|​​"Tags"{_String..},​​"Note"String|_Missing​​|>

Helper types

DiaryDate

Represents a date in a combination of the Julian and Babylonian calendars. Dates are aligned based on their daylight hours.
DiaryJulianDate[{​​_Integer|_Missing(*YearAD*),​​_Integer|_Missing(*Month*),​​_Integer|_Missing(*Day*)​​}]
DiaryBabylonianDate[{​​{_String(*King*),_Integer(*Year*)}|_Missing,​​_String|_Missing(*Month*),​​_Integer|"Beginning"|"Middle"|"End"|_Missing(*Day*)​​}]
DiaryCombinedDate[<|​​"JulianDate"_DiaryJulianDate|_Missing,​​"BabylonianDate"_DiaryBabylonianDate|_Missing,​​"Time""BeginningOfTheNight"|"FirstPartOfTheNight"|"MiddlePartOfTheNight"|"LastPartOfTheNight"|"Morning"|"Noon"|"Afternoon"|"Sunset"|"Day"|"Night"|_Missing​​|>]
“Day” and “Night” can be used in to distinguish observations like “The night of the 19th, ...” or “The 19th, ...”
Below is the list of king names for regnal years:
{"Šamaššumukin","NebukadnezarII","ArtaxerxesI","DariusII","ArtaxerxesII","ArtaxerxesIII","DariusIII","AlexanderIII","PhilipArrhidaeus","AlexanderIV","SE"}

Chronologies

In order to compute the real positions of astronomical phenomena, we need to give a chronology for converting from the Babylonian to the Julian calendar. To do so, we use a list of pairs of Babylonian and Julian dates, where dates are paired based on their daylight hours. For now, we will use the chronology from Sachs and Hunger, but in the future it may become possible to use Shanati instead.
Here is an example of a small piece of a chronology:
In[]:=
Take[$DiaryChronology,7]
Out[]=
{{DiaryBabylonianDate[{{SE,104},I,0}],DiaryJulianDate[{-207,4,2}]},{DiaryBabylonianDate[{{SE,104},II,0}],DiaryJulianDate[{-207,5,1}]},{DiaryBabylonianDate[{{SE,104},III,0}],DiaryJulianDate[{-207,5,31}]},{DiaryBabylonianDate[{{SE,64},VII,0}],DiaryJulianDate[{-247,9,19}]},{DiaryBabylonianDate[{{SE,64},VIII,0}],DiaryJulianDate[{-247,10,19}]},{DiaryBabylonianDate[{{SE,64},X,0}],DiaryJulianDate[{-247,12,17}]},{DiaryBabylonianDate[{{SE,64},XI,0}],DiaryJulianDate[{-246,1,15}]}}

DiaryDistance

Represents a distance in cubits (KÙŠ) and fingers (ŠI or U).
DiaryDistance[{_Integer|_Rational|_Missing(*cubits*),_Integer|_Missing(*fingers*)}]
Can also represent non-numerical distances.
DiaryDistance["ALittle"|...]
Note: more non-numerical distances should be added.

DiaryDuration

Represents a duration. Often used for Lunar Six quantities.
DiaryDuration[{(*bēr*),(*Degrees/UŠ*),(*ArcMinutes/NINDA*)}]

DiaryCulminatingTime

Represents a time by a culminating (ziqpu) star and an adjustment.
DiaryCulminatingTime[<|​​"CulminatingStar"_Entity|_Missing,​​"Adjustment"_DiaryDuration|_Missing,​​"AdjustmentDirection""InFrontOf"|"Behind"|_Missing​​|>]

DiaryCapacity

Represents an amount of barely, dates, mustard, cress, or sesame in MarketRates observations.
DiaryCapacity[{(*kur*),(*pān*),(*sūt*),(*qa*)}]
Each commodity is 0 if unmentioned in the diary (instead of Missing[“Unmentioned”]) and only _Missing if explicitly destroyed.

Generalized missing types

Represents data that is missing for an unspecified or unknown reason. Use Missing[“Unmentioned”] if it is clearly not mentioned, and Missing[] only for cases where it is not clear what kind of Missing[...] to use.
Missing[]
Represents data that was clearly destroyed on the original tablet. For example “the moon was [...] cubits ahead of β Capricorni”:
Missing["Destroyed"]
Represents data that was explicitly not mentioned. For example, “the moon was ahead of β Capricorni” (where the distance is unmentioned):
Missing["Unmentioned"]
There are other missing types that are specific to observation types (for example, Missing[“SalesCutOff”] in MarketRates observations.)

Inferred data

Some pieces of the diary translations appear in brackets “[]”. The data in these pieces can not always be blindly trusted, so it must be recorded which data was inferred, and what data has be entirely preserved.
The wrapped Inferred[] is used to indicate a piece of data that was inferred:
Inferred[...]
The following helper functions can be used to handle partially inferred data:
DeleteInferred
IgnoreInferred
InferredQ

Input format

There is a simplified inputting format designed for inputting data. Running processInputFormat on this converts it into the full format specified above. The following shows the basic form of the input format:
{​​<|​​"TabletID"_String,​​"Creator"_String,​​"Months"{​​<|​​"BabylonianYear"{_String|_Missing,_Integer|_Missing}|_Missing,​​"BabylonianMonth"_String|_Missing,​​"Observations"{​​DiaryObservation[...],​​<|​​"UUID"_String,​​"LineNumber"_Integer,​​"Date"DiaryInputDate[(*dayofthemonth*),(*time*)]|DiaryInputDate[(*dayofthemonth*)]|_DiaryCombinedDate|_Missing,​​"Type"_String,​​"Content"<|...|>,​​"Notes"_String|_Missing​​|>,​​...​​}​​|>​​}​​|>​​}
Dates that appear inside of observations (like with “IdealDate”) can use inputMonthDay[n, time] to represent a day and time in the specified month.