Match
Statute Title Category Model
Bases: str
, Enum
A Rule
in the Philippines involves various denominations.
It can be referred to by its
official
titleserial
titleshort
titlealias
titles
Consider something like the Maceda Law which can be dissected as follows:
Category | Mandatory | Nature | Description | Example | Matching Strategy |
---|---|---|---|---|---|
official |
yes | official | full length title | AN ACT TO PROVIDE PROTECTION TO BUYERS OF REAL ESTATE ON INSTALLMENT PAYMENTS | Statute Details |
serial |
yes | official | Statute Category + serial identifier. |
Republic Act No. 6552 | Serial Pattern regex matching |
short |
no | official | may be declared in body of statute | Realty Installment Buyer Act | A helper function |
alias |
no | unofficial | popular, undocumented means of referring to a statute | Maceda Law | Named Pattern regex matching |
Source code in statute_patterns/components/category.py
Statute Category Model
Bases: str
, Enum
Application
This concerns the serial
title described by the Statute Title Category
.
Concept
It would be difficult to identify rules if they were arbitrarily named without a fixed point of reference. For instance the Civil Code of the Philippines, an arbitrary collection of letters, would be hard to find if laws were organized alphabetically.
Fortunately, each Philippine serial
-title rule belongs to an
assignable StatuteSerialCategory
:
Serial Category name |
Shorthand value |
---|---|
Republic Act | ra |
Commonwealth Act | ca |
Act | act |
Constitution | const |
Spain | spain |
Batas Pambansa | bp |
Presidential Decree | pd |
Executive Order | eo |
Letter of Instruction | loi |
Veto Message | veto |
Rules of Court | roc |
Bar Matter | rule_bm |
Administrative Matter | rule_am |
Resolution en Banc | rule_reso |
Circular OCA | oca_cir |
Circular SC | sc_cir |
This is not an official reference but
rather a non-exhaustive taxonomy of Philippine legal rules mapped to
a enum.Enum
object.
Enum | Purpose |
---|---|
name |
for most members, can "uncamel"-ized to produce serial title |
value |
(a) folder for discovering path / (b) category usable in the database table |
Using this model simplifies the ability to navigate rules. Going back to the Civil Code described above, we're able to describe it as follows:
Aspect | Description |
---|---|
serial title | Republic Act No. 386 |
assumed folder path | /ra/386 |
category | ra |
id | 386 |
Mapped to its Rule
counterpart we get:
Field | Value | Description |
---|---|---|
cat |
ra | Serial statute category |
id |
386 | Serial identifier of the category |
Purpose
Knowing the path to a Rule
, we can later extract its contents. (Note however that there can be more than one path since in exceptional cases, the combination of category + serial id does not yield a unique rule.)
Examples:
>>> StatuteSerialCategory
<enum 'StatuteSerialCategory'>
>>> StatuteSerialCategory._member_map_
{'RepublicAct': <StatuteSerialCategory.RepublicAct: 'ra'>, 'CommonwealthAct': <StatuteSerialCategory.CommonwealthAct: 'ca'>, 'Act': <StatuteSerialCategory.Act: 'act'>, 'Constitution': <StatuteSerialCategory.Constitution: 'const'>, 'Spain': <StatuteSerialCategory.Spain: 'spain'>, 'BatasPambansa': <StatuteSerialCategory.BatasPambansa: 'bp'>, 'PresidentialDecree': <StatuteSerialCategory.PresidentialDecree: 'pd'>, 'ExecutiveOrder': <StatuteSerialCategory.ExecutiveOrder: 'eo'>, 'LetterOfInstruction': <StatuteSerialCategory.LetterOfInstruction: 'loi'>, 'VetoMessage': <StatuteSerialCategory.VetoMessage: 'veto'>, 'RulesOfCourt': <StatuteSerialCategory.RulesOfCourt: 'roc'>, 'BarMatter': <StatuteSerialCategory.BarMatter: 'rule_bm'>, 'AdministrativeMatter': <StatuteSerialCategory.AdministrativeMatter: 'rule_am'>, 'ResolutionEnBanc': <StatuteSerialCategory.ResolutionEnBanc: 'rule_reso'>, 'CircularOCA': <StatuteSerialCategory.CircularOCA: 'oca_cir'>, 'CircularSC': <StatuteSerialCategory.CircularSC: 'sc_cir'>}
Source code in statute_patterns/components/category.py
Python | |
---|---|
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
Functions
serialize(idx)
Given a member item and a valid serialized identifier, create a serial title.
Note that the identifier must be upper-cased to make this consistent with the textual convention, e.g.
pd
+570-a
=Presidential Decree No. 570-A
rule_am
+03-06-13-sc
=Administrative Matter No. 03-06-13-SC
Source code in statute_patterns/components/category.py
Statute Serial Identifier
Republic Acts
Criteria:
- Numbers should not start with 0
- Numbers should not exceed 5 digits
- Although at time of writing max RA is 11xxx (5 digits), added allowance for this to start with 2xxxx (still 5 digits)
Commonwealth Acts
Criteria:
- Numbers should not start with 0
- Numbers should not exceed 3 digits
- There are 733 Commonwealth Acts numbered sequentially
Acts of Congress
Criteria:
- Numbers should not start with 0
- Numbers should not exceed 4 digits
- There are 4275 Acts of Congress numbered sequentially
Batas Pambansa
Criteria:
- Numbers should not start with 0
- Numbers should not exceed 3 digits
- There are 889 Batas Pambansa
Presidential Decrees
Criteria:
- Numbers should not start with 0
- Numbers should not exceed 4 digits but see exceptional suffixes
- There are 2036 Presidential Decrees