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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BlueLedger Enhanced Dataset Schema v2.0
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
This document describes the data structure for the BlueLedger Enhanced Police Officer Directory dataset.
|
| 5 |
+
|
| 6 |
+
## Dataset Structure
|
| 7 |
+
|
| 8 |
+
### Top Level
|
| 9 |
+
```json
|
| 10 |
+
{
|
| 11 |
+
"dataset_metadata": { ... },
|
| 12 |
+
"officers": [ ... ]
|
| 13 |
+
}
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
### dataset_metadata
|
| 17 |
+
- **name**: Dataset name
|
| 18 |
+
- **version**: Semantic version number
|
| 19 |
+
- **generated_at**: ISO 8601 timestamp
|
| 20 |
+
- **total_officers**: Count of officer records
|
| 21 |
+
- **total_offense_records**: Total offense incidents across all officers
|
| 22 |
+
- **compliance**: App store and data standards compliance info
|
| 23 |
+
- **sources**: List of data sources with verification levels
|
| 24 |
+
|
| 25 |
+
### officer Record
|
| 26 |
+
|
| 27 |
+
#### officer_id
|
| 28 |
+
Unique identifier: `BL-{STATE}-{NUMBER}`
|
| 29 |
+
Example: `BL-WA-000001`
|
| 30 |
+
|
| 31 |
+
#### personal_info
|
| 32 |
+
- **full_name**: Complete name as recorded
|
| 33 |
+
- **name_last**: Last name/surname
|
| 34 |
+
- **name_first**: First name/given name
|
| 35 |
+
|
| 36 |
+
#### employment
|
| 37 |
+
- **department**: Law enforcement agency name
|
| 38 |
+
- **state**: Full state name
|
| 39 |
+
- **rank**: Officer rank/position
|
| 40 |
+
- **status**: Employment status (Active, Inactive, Terminated, Retired)
|
| 41 |
+
- **badge_number**: Badge/shield number (if available)
|
| 42 |
+
- **hire_date**: Date of hire (ISO 8601)
|
| 43 |
+
- **separation_date**: Date of separation (ISO 8601, null if active)
|
| 44 |
+
|
| 45 |
+
#### certification
|
| 46 |
+
- **certification_status**: POST certification status
|
| 47 |
+
- **certification_number**: State POST certification ID
|
| 48 |
+
- **certification_date**: Date certification issued
|
| 49 |
+
- **expiration_date**: Certification expiration date
|
| 50 |
+
- **state_post_agency**: State jurisdiction
|
| 51 |
+
- **certifying_authority**: Full name of POST agency
|
| 52 |
+
|
| 53 |
+
#### verification_sources
|
| 54 |
+
- **primary_gov_source**: Official state POST commission
|
| 55 |
+
- **url**: Official .gov URL (required for app store compliance)
|
| 56 |
+
- **agency**: Agency name
|
| 57 |
+
- **verified**: Verification status (boolean)
|
| 58 |
+
- **last_verified**: Last verification timestamp
|
| 59 |
+
- **profile_links**: Array of secondary sources (CPDP, etc.)
|
| 60 |
+
|
| 61 |
+
#### offense_records
|
| 62 |
+
- **total_count**: Total number of recorded incidents
|
| 63 |
+
- **categories**: Breakdown by offense type
|
| 64 |
+
- use_of_force
|
| 65 |
+
- misconduct
|
| 66 |
+
- civil_rights_violation
|
| 67 |
+
- criminal_charges
|
| 68 |
+
- policy_violation
|
| 69 |
+
- excessive_force
|
| 70 |
+
- other
|
| 71 |
+
- **incidents**: Array of incident objects
|
| 72 |
+
|
| 73 |
+
##### incident Object
|
| 74 |
+
- **incident_id**: Unique incident identifier
|
| 75 |
+
- **date**: Incident date (ISO 8601)
|
| 76 |
+
- **category**: Incident category
|
| 77 |
+
- **description**: Detailed description
|
| 78 |
+
- **disposition**: Investigation outcome (Sustained, Not Sustained, Exonerated, Unfounded, etc.)
|
| 79 |
+
- **discipline**: Disciplinary action taken
|
| 80 |
+
- **verification_source**: Source documentation
|
| 81 |
+
- **type**: Source type (Internal Affairs, Court Record, etc.)
|
| 82 |
+
- **url**: Source URL (preferably .gov)
|
| 83 |
+
- **document_id**: Official document ID
|
| 84 |
+
- **verified**: Verification status
|
| 85 |
+
- **status**: Case status (Open, Closed, Under Investigation)
|
| 86 |
+
- **legal_outcome**: Legal proceedings info
|
| 87 |
+
- **civil_lawsuit**: Boolean
|
| 88 |
+
- **criminal_charges**: Boolean
|
| 89 |
+
- **settlement_amount**: Dollar amount if applicable
|
| 90 |
+
|
| 91 |
+
#### data_quality
|
| 92 |
+
- **completeness_score**: 0-100 score indicating data completeness
|
| 93 |
+
- **has_gov_verification**: Boolean indicating .gov link presence
|
| 94 |
+
- **last_updated**: Last update timestamp
|
| 95 |
+
- **data_source**: Original data source
|
| 96 |
+
|
| 97 |
+
## Data Standards
|
| 98 |
+
|
| 99 |
+
### App Store Compliance
|
| 100 |
+
- ✅ All officer records MUST have a valid .gov verification URL
|
| 101 |
+
- ✅ Offense records MUST cite verifiable sources
|
| 102 |
+
- ✅ No unverified allegations included
|
| 103 |
+
- ✅ Clear data provenance and update timestamps
|
| 104 |
+
|
| 105 |
+
### URL Requirements
|
| 106 |
+
- Primary sources MUST be official government (.gov) domains
|
| 107 |
+
- State POST commission URLs are the gold standard
|
| 108 |
+
- Secondary sources (CPDP, etc.) are supplementary
|
| 109 |
+
|
| 110 |
+
### Date Format
|
| 111 |
+
All dates use ISO 8601: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`
|
| 112 |
+
|
| 113 |
+
### Null Values
|
| 114 |
+
- `null` used for unavailable data (not empty strings)
|
| 115 |
+
- Distinguished from "Unknown" which indicates active uncertainty
|
| 116 |
+
|
| 117 |
+
## Usage Examples
|
| 118 |
+
|
| 119 |
+
### Python
|
| 120 |
+
```python
|
| 121 |
+
import json
|
| 122 |
+
|
| 123 |
+
with open('blueledger_enhanced_v2.json', 'r') as f:
|
| 124 |
+
data = json.load(f)
|
| 125 |
+
|
| 126 |
+
# Access officers
|
| 127 |
+
for officer in data['officers']:
|
| 128 |
+
print(f"{officer['personal_info']['full_name']} - {officer['employment']['department']}")
|
| 129 |
+
print(f"Gov Verification: {officer['verification_sources']['primary_gov_source']['url']}")
|
| 130 |
+
print(f"Total Offenses: {officer['offense_records']['total_count']}")
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
### Pandas
|
| 134 |
+
```python
|
| 135 |
+
import pandas as pd
|
| 136 |
+
|
| 137 |
+
# Load CSV
|
| 138 |
+
df = pd.read_csv('blueledger_enhanced_v2.csv')
|
| 139 |
+
|
| 140 |
+
# Filter officers with offenses
|
| 141 |
+
officers_with_offenses = df[df['total_offenses'] > 0]
|
| 142 |
+
|
| 143 |
+
# Group by state
|
| 144 |
+
state_summary = df.groupby('state').agg({
|
| 145 |
+
'officer_id': 'count',
|
| 146 |
+
'total_offenses': 'sum'
|
| 147 |
+
})
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
## Data Integration Notes
|
| 151 |
+
|
| 152 |
+
### Adding Offense Records
|
| 153 |
+
Real offense data should be sourced from:
|
| 154 |
+
1. State POST disciplinary databases
|
| 155 |
+
2. Court records (PACER, state court systems)
|
| 156 |
+
3. Internal affairs reports (via FOIA requests)
|
| 157 |
+
4. Verified journalist databases (CPDP, etc.)
|
| 158 |
+
|
| 159 |
+
### Verification Workflow
|
| 160 |
+
1. Obtain source document
|
| 161 |
+
2. Verify authenticity via .gov source
|
| 162 |
+
3. Extract structured data
|
| 163 |
+
4. Add verification metadata
|
| 164 |
+
5. Update last_verified timestamp
|
| 165 |
+
|
| 166 |
+
## License
|
| 167 |
+
Public Domain - Government Data
|
| 168 |
+
|
| 169 |
+
## Contact
|
| 170 |
+
For questions or contributions, see README.md
|