a pythonic query language
Sign in or create a new account.
|125.0||Beaten/Bludgeoned with instrument|
|34.0||Fell from a height|
|18.0||Chemical agent/Pepper spray|
|1.0||Restraint / Overdose|
|1.0||Jumped / Fell|
Address, Age, CauseOfDeath, City, County, Date, DayOfMillenium, DayOfWeek, Description, ImageURL, LawEnforcementAgency, Month, Name, NewsURL, OfficialDisposition, Prace, Sex, State, SymptomsOfMentalIllness, Year, Zip
Both fields and conditions are made up of terms.
A term is a valid Python expression in a name space made up of: database parameters; any imported python modules; PyQL Aggregators such as Average (A), Sum (S), and Replace (R); and other domain specific terms.
|About the Fatal Encounter Database||Sample Queries|
This database was download as a spreadsheet from FatalEncounters.org. Brian Burghart maintains this spreadsheet and welcomes your support. You can e-mail Brian d.brian [at] fatalencounters.org.
The first step in importing Brian's spreadsheet into a PyQL database involved taking non-alpha numberic characters out of headers and using them in CamelCase. For example, the spreadsheet header of 'law enforcement agency' becomes the database parameter 'LawEnforcementAgency'.
Agile Access to Database Parameters
The CamelCaseFormatting of database parameters is logical, readable, and verbose. With domain specific query languages you get to make the rules for parameter reference. And here we like:
Access parameters by their capitalized letters and fill in lower case letters as needed to remove ambiguity.
Like this for getting the the Date,Name,CauseOfDeath,OfficialDisposition, and the Prace (perceived race) for fatal encounters with law enforcement in Multnomah County:
To see the number of fatal encounters with law enforcement for each city in the database, use the PyQL:
This query form is handy for breakdown by any parameter. To see fatal encounters by state, use the PyQL: S(1),R(St)@St
And likewise for CauseOfDeath, use the PyQL: S(1),R(COD)@COD
And for Prace (perceived race), use the PyQL: S(1),R(P)@P
To see details of all fatal encounters in Portland, Oregon, use the PyQL: Name,Date,COD,OD,SOMI@City='Portland' and State='OR' s.