openphar 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. checksums.yaml +7 -0
  2. data/README.adoc +221 -0
  3. data/lib/openphar/cli/main.rb +137 -0
  4. data/lib/openphar/cli.rb +11 -0
  5. data/lib/openphar/core/slug_generator.rb +107 -0
  6. data/lib/openphar/core.rb +11 -0
  7. data/lib/openphar/errors/configuration_error.rb +8 -0
  8. data/lib/openphar/errors/monograph_not_found_error.rb +15 -0
  9. data/lib/openphar/errors/parse_error.rb +18 -0
  10. data/lib/openphar/errors/unknown_format_error.rb +8 -0
  11. data/lib/openphar/errors/unknown_publisher_error.rb +8 -0
  12. data/lib/openphar/errors/unknown_type_error.rb +8 -0
  13. data/lib/openphar/errors/validation_error.rb +15 -0
  14. data/lib/openphar/errors.rb +17 -0
  15. data/lib/openphar/exporters/coverage_validator.rb +265 -0
  16. data/lib/openphar/exporters/neo4j/model_registry.rb +130 -0
  17. data/lib/openphar/exporters/neo4j/node_builder.rb +84 -0
  18. data/lib/openphar/exporters/neo4j/property_mapper.rb +154 -0
  19. data/lib/openphar/exporters/neo4j/relationship_builder.rb +87 -0
  20. data/lib/openphar/exporters/neo4j.rb +16 -0
  21. data/lib/openphar/exporters/neo4j_exporter.rb +199 -0
  22. data/lib/openphar/exporters.rb +15 -0
  23. data/lib/openphar/linkers/chp/cross_edition_linker.rb +101 -0
  24. data/lib/openphar/linkers/chp.rb +11 -0
  25. data/lib/openphar/linkers/cross_publisher_linker.rb +295 -0
  26. data/lib/openphar/linkers/herbapedia_linker.rb +125 -0
  27. data/lib/openphar/linkers.rb +13 -0
  28. data/lib/openphar/migrators/chp/classifier.rb +86 -0
  29. data/lib/openphar/migrators/chp.rb +15 -0
  30. data/lib/openphar/migrators/chp_migrator.rb +130 -0
  31. data/lib/openphar/migrators/jp_migrator.rb +345 -0
  32. data/lib/openphar/migrators/phint_migrator.rb +426 -0
  33. data/lib/openphar/migrators.rb +15 -0
  34. data/lib/openphar/models/ahp.rb +25 -0
  35. data/lib/openphar/models/amino_acid_monograph.rb +28 -0
  36. data/lib/openphar/models/api.rb +29 -0
  37. data/lib/openphar/models/assay_specification.rb +19 -0
  38. data/lib/openphar/models/base_entity.rb +221 -0
  39. data/lib/openphar/models/biological_substance_monograph.rb +31 -0
  40. data/lib/openphar/models/chemical_drug_monograph.rb +39 -0
  41. data/lib/openphar/models/chp/biologic.rb +28 -0
  42. data/lib/openphar/models/chp/chemical_preparation.rb +28 -0
  43. data/lib/openphar/models/chp/chemical_substance.rb +28 -0
  44. data/lib/openphar/models/chp/general_chapter.rb +30 -0
  45. data/lib/openphar/models/chp/monograph.rb +116 -0
  46. data/lib/openphar/models/chp/section.rb +37 -0
  47. data/lib/openphar/models/chp/tcm_crude_drug.rb +28 -0
  48. data/lib/openphar/models/chp/tcm_extract.rb +29 -0
  49. data/lib/openphar/models/chp/tcm_formulation.rb +28 -0
  50. data/lib/openphar/models/chp.rb +33 -0
  51. data/lib/openphar/models/crude_drug_monograph.rb +31 -0
  52. data/lib/openphar/models/edition.rb +41 -0
  53. data/lib/openphar/models/formulation_monograph.rb +31 -0
  54. data/lib/openphar/models/hkcmms.rb +26 -0
  55. data/lib/openphar/models/identification_specification.rb +19 -0
  56. data/lib/openphar/models/jp/kampo_formula.rb +94 -0
  57. data/lib/openphar/models/jp.rb +21 -0
  58. data/lib/openphar/models/limit.rb +54 -0
  59. data/lib/openphar/models/mineral_substance_monograph.rb +28 -0
  60. data/lib/openphar/models/monograph.rb +58 -0
  61. data/lib/openphar/models/ph_int/buffer_solution.rb +38 -0
  62. data/lib/openphar/models/ph_int/dosage_form_monograph.rb +43 -0
  63. data/lib/openphar/models/ph_int/radiopharmaceutical_monograph.rb +52 -0
  64. data/lib/openphar/models/ph_int/reagent.rb +50 -0
  65. data/lib/openphar/models/ph_int/reference_substance.rb +50 -0
  66. data/lib/openphar/models/ph_int/test_method.rb +50 -0
  67. data/lib/openphar/models/ph_int/test_solution.rb +39 -0
  68. data/lib/openphar/models/ph_int/volumetric_solution.rb +38 -0
  69. data/lib/openphar/models/ph_int.rb +37 -0
  70. data/lib/openphar/models/physical_specification.rb +17 -0
  71. data/lib/openphar/models/publisher.rb +98 -0
  72. data/lib/openphar/models/purity_specification.rb +16 -0
  73. data/lib/openphar/models/supplement.rb +31 -0
  74. data/lib/openphar/models/test_specification.rb +29 -0
  75. data/lib/openphar/models/thp.rb +24 -0
  76. data/lib/openphar/models/vitamin_monograph.rb +28 -0
  77. data/lib/openphar/models.rb +58 -0
  78. data/lib/openphar/monograph_merger.rb +374 -0
  79. data/lib/openphar/parsers/base_monograph_parser.rb +108 -0
  80. data/lib/openphar/parsers/jp_html_parser.rb +92 -0
  81. data/lib/openphar/parsers/jp_html_parser_base.rb +113 -0
  82. data/lib/openphar/parsers/jp_ja_html_parser.rb +220 -0
  83. data/lib/openphar/parsers/phint_json_parser.rb +332 -0
  84. data/lib/openphar/parsers.rb +21 -0
  85. data/lib/openphar/registry/publisher_registry.rb +46 -0
  86. data/lib/openphar/registry/type_registry.rb +147 -0
  87. data/lib/openphar/registry.rb +24 -0
  88. data/lib/openphar/repositories/monograph_repository.rb +350 -0
  89. data/lib/openphar/repositories.rb +11 -0
  90. data/lib/openphar/transformers/jsonld_transformer.rb +106 -0
  91. data/lib/openphar/transformers.rb +11 -0
  92. data/lib/openphar/version.rb +5 -0
  93. data/lib/openphar.rb +119 -0
  94. data/ontology/bibliographic/edition.ttl +267 -0
  95. data/ontology/context/chp.jsonld +69 -0
  96. data/ontology/context/crude-drugs.jsonld +56 -0
  97. data/ontology/context/pharmacopoeia.jsonld +631 -0
  98. data/ontology/core/identification.ttl +456 -0
  99. data/ontology/core/pharmacopoeia.ttl +3427 -0
  100. data/ontology/core/substance-form.ttl +302 -0
  101. data/ontology/core/unit.ttl +493 -0
  102. data/ontology/publisher/chp/extensions.ttl +186 -0
  103. data/ontology/publisher/phint/extensions.ttl +327 -0
  104. data/ontology/quality/test-method.ttl +610 -0
  105. data/shapes/chp/monograph.ttl +153 -0
  106. data/shapes/edition-shapes.ttl +230 -0
  107. data/shapes/monograph-shapes.ttl +1324 -0
  108. metadata +319 -0
@@ -0,0 +1,327 @@
1
+ # Open Pharmacopoeia - International Pharmacopoeia (Ph.Int.) Extensions
2
+ #
3
+ # This module defines extensions specific to the International Pharmacopoeia,
4
+ # including radiopharmaceuticals, gradient chromatography, and reagent registry.
5
+ #
6
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
7
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
8
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
9
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
10
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
11
+ @prefix op: <https://www.openphar.org/ontology/core/> .
12
+ @prefix phint: <https://www.openphar.org/ontology/publisher/phint/> .
13
+
14
+ <https://www.openphar.org/ontology/publisher/phint/>
15
+ a owl:Ontology ;
16
+ rdfs:label "International Pharmacopoeia Extensions"@en ;
17
+ rdfs:comment "Ontology extensions specific to the International Pharmacopoeia (Ph.Int.)."@en ;
18
+ owl:imports <https://www.openphar.org/ontology/core/> .
19
+
20
+ # =============================================================================
21
+ # RADIOPHARMACEUTICAL MONOGRAPH
22
+ # =============================================================================
23
+
24
+ phint:RadiopharmaceuticalMonograph
25
+ a owl:Class ;
26
+ rdfs:label "Radiopharmaceutical Monograph"@en ;
27
+ rdfs:comment "A monograph for a radiopharmaceutical substance, containing radionuclide-specific data."@en ;
28
+ rdfs:subClassOf op:PharmaceuticalSubstanceMonograph .
29
+
30
+ # Radionuclide properties
31
+
32
+ phint:hasRadionuclide
33
+ a owl:ObjectProperty ;
34
+ rdfs:label "has radionuclide"@en ;
35
+ rdfs:comment "The radionuclide component of a radiopharmaceutical."@en ;
36
+ rdfs:domain phint:RadiopharmaceuticalMonograph ;
37
+ rdfs:range phint:Radionuclide .
38
+
39
+ phint:Radionuclide
40
+ a owl:Class ;
41
+ rdfs:label "Radionuclide"@en ;
42
+ rdfs:comment "A radioactive nuclide used in radiopharmaceuticals."@en .
43
+
44
+ phint:radionuclideSymbol
45
+ a owl:DatatypeProperty ;
46
+ rdfs:label "radionuclide symbol"@en ;
47
+ rdfs:comment "The symbol of the radionuclide (e.g., '99mTc', '131I')."@en ;
48
+ rdfs:domain phint:Radionuclide ;
49
+ rdfs:range xsd:string .
50
+
51
+ phint:halfLife
52
+ a owl:DatatypeProperty ;
53
+ rdfs:label "half-life"@en ;
54
+ rdfs:comment "The physical half-life of the radionuclide."@en ;
55
+ rdfs:domain phint:Radionuclide ;
56
+ rdfs:range xsd:duration .
57
+
58
+ phint:halfLifeValue
59
+ a owl:DatatypeProperty ;
60
+ rdfs:label "half-life value"@en ;
61
+ rdfs:comment "The half-life value as a decimal number."@en ;
62
+ rdfs:domain phint:Radionuclide ;
63
+ rdfs:range xsd:decimal .
64
+
65
+ phint:halfLifeUnit
66
+ a owl:DatatypeProperty ;
67
+ rdfs:label "half-life unit"@en ;
68
+ rdfs:comment "The unit of the half-life (e.g., 'hours', 'days')."@en ;
69
+ rdfs:domain phint:Radionuclide ;
70
+ rdfs:range xsd:string .
71
+
72
+ phint:emissionType
73
+ a owl:DatatypeProperty ;
74
+ rdfs:label "emission type"@en ;
75
+ rdfs:comment "The type of radioactive emission (gamma, beta, positron, alpha)."@en ;
76
+ rdfs:domain phint:Radionuclide ;
77
+ rdfs:range xsd:string .
78
+
79
+ phint:gammaEnergy
80
+ a owl:DatatypeProperty ;
81
+ rdfs:label "gamma energy"@en ;
82
+ rdfs:comment "The principal gamma photon energy in keV."@en ;
83
+ rdfs:domain phint:Radionuclide ;
84
+ rdfs:range xsd:decimal .
85
+
86
+ # Radionuclide individuals
87
+
88
+ phint:Technetium-99m
89
+ a phint:Radionuclide ;
90
+ skos:prefLabel "Technetium-99m"@en ;
91
+ phint:radionuclideSymbol "99mTc" ;
92
+ phint:halfLifeValue 6.0 ;
93
+ phint:halfLifeUnit "hours" ;
94
+ phint:emissionType "gamma" ;
95
+ phint:gammaEnergy 140 .
96
+
97
+ phint:Iodine-131
98
+ a phint:Radionuclide ;
99
+ skos:prefLabel "Iodine-131"@en ;
100
+ phint:radionuclideSymbol "131I" ;
101
+ phint:halfLifeValue 8.0 ;
102
+ phint:halfLifeUnit "days" ;
103
+ phint:emissionType "beta" ;
104
+ phint:emissionType "gamma" .
105
+
106
+ # =============================================================================
107
+ # GRADIENT CHROMATOGRAPHY
108
+ # =============================================================================
109
+
110
+ phint:GradientProgram
111
+ a owl:Class ;
112
+ rdfs:label "HPLC Gradient Program"@en ;
113
+ rdfs:comment "A gradient elution program for HPLC analysis."@en .
114
+
115
+ phint:hasGradientProgram
116
+ a owl:ObjectProperty ;
117
+ rdfs:label "has gradient program"@en ;
118
+ rdfs:comment "The gradient program used in an HPLC assay."@en ;
119
+ rdfs:domain op:AssaySpecification ;
120
+ rdfs:range phint:GradientProgram .
121
+
122
+ phint:hasGradientStep
123
+ a owl:ObjectProperty ;
124
+ rdfs:label "has gradient step"@en ;
125
+ rdfs:comment "A step in the gradient program."@en ;
126
+ rdfs:domain phint:GradientProgram ;
127
+ rdfs:range phint:GradientStep ;
128
+ rdfs:subPropertyOf rdf:Seq .
129
+
130
+ phint:GradientStep
131
+ a owl:Class ;
132
+ rdfs:label "Gradient Step"@en ;
133
+ rdfs:comment "A single step in an HPLC gradient program."@en .
134
+
135
+ phint:stepNumber
136
+ a owl:DatatypeProperty ;
137
+ rdfs:label "step number"@en ;
138
+ rdfs:comment "The sequence number of this step."@en ;
139
+ rdfs:domain phint:GradientStep ;
140
+ rdfs:range xsd:integer .
141
+
142
+ phint:stepTime
143
+ a owl:DatatypeProperty ;
144
+ rdfs:label "step time"@en ;
145
+ rdfs:comment "The time point or duration for this step (in minutes)."@en ;
146
+ rdfs:domain phint:GradientStep ;
147
+ rdfs:range xsd:decimal .
148
+
149
+ phint:mobilePhaseA
150
+ a owl:DatatypeProperty ;
151
+ rdfs:label "mobile phase A percentage"@en ;
152
+ rdfs:comment "The percentage of mobile phase A at this step."@en ;
153
+ rdfs:domain phint:GradientStep ;
154
+ rdfs:range xsd:decimal .
155
+
156
+ phint:mobilePhaseB
157
+ a owl:DatatypeProperty ;
158
+ rdfs:label "mobile phase B percentage"@en ;
159
+ rdfs:comment "The percentage of mobile phase B at this step."@en ;
160
+ rdfs:domain phint:GradientStep ;
161
+ rdfs:range xsd:decimal .
162
+
163
+ phint:flowRate
164
+ a owl:DatatypeProperty ;
165
+ rdfs:label "flow rate"@en ;
166
+ rdfs:comment "The flow rate in mL/min."@en ;
167
+ rdfs:domain phint:GradientProgram ;
168
+ rdfs:range xsd:decimal .
169
+
170
+ phint:columnTemperature
171
+ a owl:DatatypeProperty ;
172
+ rdfs:label "column temperature"@en ;
173
+ rdfs:comment "The column temperature in degrees Celsius."@en ;
174
+ rdfs:domain phint:GradientProgram ;
175
+ rdfs:range xsd:decimal .
176
+
177
+ # =============================================================================
178
+ # REAGENT REGISTRY
179
+ # =============================================================================
180
+
181
+ phint:TestSolution
182
+ a owl:Class ;
183
+ rdfs:label "Test Solution"@en ;
184
+ rdfs:comment "A solution used in pharmacopoeial tests and assays."@en .
185
+
186
+ phint:VolumetricSolution
187
+ a owl:Class ;
188
+ rdfs:label "Volumetric Solution"@en ;
189
+ rdfs:comment "A solution of precisely known concentration used for titrations."@en .
190
+
191
+ phint:BufferSolution
192
+ a owl:Class ;
193
+ rdfs:label "Buffer Solution"@en ;
194
+ rdfs:comment "A solution that resists changes in pH."@en .
195
+
196
+ phint:ReferenceSubstance
197
+ a owl:Class ;
198
+ rdfs:label "Chemical Reference Substance"@en ;
199
+ rdfs:comment "A chemical reference substance used as a standard in tests."@en .
200
+
201
+ # Reagent properties
202
+
203
+ phint:reagentId
204
+ a owl:DatatypeProperty ;
205
+ rdfs:label "reagent ID"@en ;
206
+ rdfs:comment "The identifier for the reagent in the pharmacopoeia."@en ;
207
+ rdfs:domain phint:TestSolution ;
208
+ rdfs:range xsd:string .
209
+
210
+ phint:molarity
211
+ a owl:DatatypeProperty ;
212
+ rdfs:label "molarity"@en ;
213
+ rdfs:comment "The molar concentration (e.g., '0.1 mol/L')."@en ;
214
+ rdfs:domain phint:VolumetricSolution ;
215
+ rdfs:range xsd:string .
216
+
217
+ phint:normality
218
+ a owl:DatatypeProperty ;
219
+ rdfs:label "normality"@en ;
220
+ rdfs:comment "The normality of the solution."@en ;
221
+ rdfs:domain phint:VolumetricSolution ;
222
+ rdfs:range xsd:string .
223
+
224
+ phint:targetPH
225
+ a owl:DatatypeProperty ;
226
+ rdfs:label "target pH"@en ;
227
+ rdfs:comment "The target pH value of the buffer."@en ;
228
+ rdfs:domain phint:BufferSolution ;
229
+ rdfs:range xsd:decimal .
230
+
231
+ phint:preparationMethod
232
+ a owl:DatatypeProperty ;
233
+ rdfs:label "preparation method"@en ;
234
+ rdfs:comment "Instructions for preparing the solution."@en ;
235
+ rdfs:domain phint:TestSolution ;
236
+ rdfs:range rdf:langString .
237
+
238
+ phint:standardizationMethod
239
+ a owl:DatatypeProperty ;
240
+ rdfs:label "standardization method"@en ;
241
+ rdfs:comment "Method for standardizing the volumetric solution."@en ;
242
+ rdfs:domain phint:VolumetricSolution ;
243
+ rdfs:range rdf:langString .
244
+
245
+ phint:storageCondition
246
+ a owl:DatatypeProperty ;
247
+ rdfs:label "storage condition"@en ;
248
+ rdfs:comment "Storage conditions for the reagent."@en ;
249
+ rdfs:domain phint:TestSolution ;
250
+ rdfs:range rdf:langString .
251
+
252
+ phint:shelfLife
253
+ a owl:DatatypeProperty ;
254
+ rdfs:label "shelf life"@en ;
255
+ rdfs:comment "The shelf life of the reagent."@en ;
256
+ rdfs:domain phint:TestSolution ;
257
+ rdfs:range xsd:string .
258
+
259
+ # Reference substance properties
260
+
261
+ phint:referenceSubstanceId
262
+ a owl:DatatypeProperty ;
263
+ rdfs:label "reference substance ID"@en ;
264
+ rdfs:comment "The WHO reference substance identifier."@en ;
265
+ rdfs:domain phint:ReferenceSubstance ;
266
+ rdfs:range xsd:string .
267
+
268
+ phint:chemicalName
269
+ a owl:DatatypeProperty ;
270
+ rdfs:label "chemical name"@en ;
271
+ rdfs:comment "The chemical name of the reference substance."@en ;
272
+ rdfs:domain phint:ReferenceSubstance ;
273
+ rdfs:range rdf:langString .
274
+
275
+ phint:catalogNumber
276
+ a owl:DatatypeProperty ;
277
+ rdfs:label "catalog number"@en ;
278
+ rdfs:comment "The catalog number for ordering."@en ;
279
+ rdfs:domain phint:ReferenceSubstance ;
280
+ rdfs:range xsd:string .
281
+
282
+ phint:assignedContent
283
+ a owl:DatatypeProperty ;
284
+ rdfs:label "assigned content"@en ;
285
+ rdfs:comment "The assigned content/purity of the reference substance."@en ;
286
+ rdfs:domain phint:ReferenceSubstance ;
287
+ rdfs:range xsd:string .
288
+
289
+ # =============================================================================
290
+ # PH.INT.-SPECIFIC TEST TYPES
291
+ # =============================================================================
292
+
293
+ phint:DisintegrationTest
294
+ a owl:Class ;
295
+ rdfs:label "Disintegration Test"@en ;
296
+ rdfs:comment "Test for disintegration time of tablets and capsules."@en ;
297
+ rdfs:subClassOf op:Test .
298
+
299
+ phint:DissolutionTest
300
+ a owl:Class ;
301
+ rdfs:label "Dissolution Test"@en ;
302
+ rdfs:comment "Test for dissolution rate of active ingredients."@en ;
303
+ rdfs:subClassOf op:Test .
304
+
305
+ phint:UniformityOfContent
306
+ a owl:Class ;
307
+ rdfs:label "Uniformity of Content Test"@en ;
308
+ rdfs:comment "Test for uniformity of content in single-dose units."@en ;
309
+ rdfs:subClassOf op:Test .
310
+
311
+ phint:UniformityOfMass
312
+ a owl:Class ;
313
+ rdfs:label "Uniformity of Mass Test"@en ;
314
+ rdfs:comment "Test for uniformity of mass in single-dose units."@en ;
315
+ rdfs:subClassOf op:Test .
316
+
317
+ phint:WaterDetermination
318
+ a owl:Class ;
319
+ rdfs:label "Water Determination Test"@en ;
320
+ rdfs:comment "Test for water content, typically by Karl Fischer titration."@en ;
321
+ rdfs:subClassOf op:Test .
322
+
323
+ phint:RelatedSubstances
324
+ a owl:Class ;
325
+ rdfs:label "Related Substances Test"@en ;
326
+ rdfs:comment "Test for impurities and related substances."@en ;
327
+ rdfs:subClassOf op:Test .