44
55from neomodel import (
66 StructuredNode ,
7- RelationshipTo , RelationshipFrom , Relationship ,
8- StringProperty , DateProperty ,
9- UniqueIdProperty , One
7+ RelationshipTo ,
8+ RelationshipFrom ,
9+ Relationship ,
10+ StringProperty ,
11+ DateProperty ,
12+ UniqueIdProperty ,
13+ One ,
1014)
1115
1216
@@ -16,20 +20,26 @@ class StateID(StructuredNode, JsonSerializable):
1620 law enforcement agencies. For example, in New York, this would be
1721 the Tax ID Number.
1822 """
23+
1924 id_name = StringProperty () # e.g. "Tax ID Number"
2025 state = StringProperty (choices = State .choices ()) # e.g. "NY"
2126 value = StringProperty () # e.g. "958938"
22- officer = RelationshipFrom (' Officer' , "HAS_STATE_ID" , cardinality = One )
27+ officer = RelationshipFrom (" Officer" , "HAS_STATE_ID" , cardinality = One )
2328
2429 def __repr__ (self ):
2530 return f"<StateID: Officer { self .officer_id } , { self .state } >"
2631
2732
2833class Officer (StructuredNode , JsonSerializable ):
2934 __property_order__ = [
30- "uid" , "first_name" , "middle_name" ,
31- "last_name" , "suffix" , "ethnicity" ,
32- "gender" , "date_of_birth"
35+ "uid" ,
36+ "first_name" ,
37+ "middle_name" ,
38+ "last_name" ,
39+ "suffix" ,
40+ "ethnicity" ,
41+ "gender" ,
42+ "date_of_birth" ,
3343 ]
3444 __hidden_properties__ = ["citations" ]
3545
@@ -43,19 +53,23 @@ class Officer(StructuredNode, JsonSerializable):
4353 date_of_birth = DateProperty ()
4454
4555 # Relationships
46- state_ids = RelationshipTo (' StateID' , "HAS_STATE_ID" )
56+ state_ids = RelationshipTo (" StateID" , "HAS_STATE_ID" )
4757 units = Relationship (
48- 'backend.database.models.agency.Unit' , "MEMBER_OF_UNIT" )
58+ "backend.database.models.agency.Unit" , "MEMBER_OF_UNIT"
59+ )
4960 litigation = Relationship (
50- 'backend.database.models.litigation.Litigation' , "NAMED_IN" )
61+ "backend.database.models.litigation.Litigation" , "NAMED_IN"
62+ )
5163 allegations = Relationship (
52- 'backend.database.models.complaint.Allegation' , "ACCUSED_OF" )
64+ "backend.database.models.complaint.Allegation" , "ACCUSED_OF"
65+ )
5366 investigations = Relationship (
54- ' backend.database.models.complaint.Investigation' , "LEAD_BY" )
55- commands = Relationship (
56- ' backend.database.models.agency.Unit' , "COMMANDS" )
67+ " backend.database.models.complaint.Investigation" , "LEAD_BY"
68+ )
69+ commands = Relationship ( " backend.database.models.agency.Unit" , "COMMANDS" )
5770 citations = RelationshipTo (
58- 'backend.database.models.source.Source' , "UPDATED_BY" , model = Citation )
71+ "backend.database.models.source.Source" , "UPDATED_BY" , model = Citation
72+ )
5973
6074 def __repr__ (self ):
61- return f"<Officer { self .element_id } >"
75+ return f"<Officer { self .uid } >"
0 commit comments