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
data/lib/openphar.rb ADDED
@@ -0,0 +1,119 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Openphar - Machine-readable pharmacopoeia data library
4
+ #
5
+ # A model-driven library for parsing, transforming, and exporting
6
+ # pharmacopoeia data from multiple publishers (JP, Ph.Int., etc.)
7
+ #
8
+ # @example Basic usage
9
+ # require 'openphar'
10
+ #
11
+ # # Parse pharmacopoeia data
12
+ # parser = Openphar::Parsers::PhIntJsonParser.new
13
+ # monographs = parser.parse_directory('./data')
14
+ #
15
+ # # Export to Neo4j
16
+ # exporter = Openphar::Exporters::Neo4jExporter.new
17
+ # exporter.export_monographs('./data/jp', './output/neo4j')
18
+
19
+ module Openphar
20
+ # Base error class for all Openphar errors
21
+ class Error < StandardError; end
22
+
23
+ class << self
24
+ # Returns the global configuration
25
+ #
26
+ # @return [Configuration]
27
+ def configuration
28
+ @configuration ||= Configuration.new
29
+ end
30
+
31
+ # Yields the configuration for setup
32
+ #
33
+ # @yield [Configuration]
34
+ def configure
35
+ yield(configuration)
36
+ end
37
+
38
+ # Returns the path to the ontology files
39
+ #
40
+ # @return [String]
41
+ def ontology_path
42
+ @ontology_path ||= File.expand_path('../ontology', __dir__)
43
+ end
44
+
45
+ # Returns the path to the data files
46
+ #
47
+ # @return [String]
48
+ def data_path
49
+ @data_path ||= File.expand_path('../data', __dir__)
50
+ end
51
+
52
+ # Returns the base IRI for the ontology
53
+ #
54
+ # @return [String]
55
+ def base_iri
56
+ 'https://www.openphar.org'
57
+ end
58
+
59
+ # Returns the Herbapedia base IRI
60
+ #
61
+ # @return [String]
62
+ def herbapedia_iri
63
+ 'https://www.herbapedia.org'
64
+ end
65
+
66
+ # Convenience method to access the monograph repository
67
+ #
68
+ # @return [Repositories::MonographRepository]
69
+ def repository
70
+ Repositories::MonographRepository.instance
71
+ end
72
+ end
73
+
74
+ # Configuration class for library settings
75
+ #
76
+ # @example
77
+ # Openphar.configure do |config|
78
+ # config.data_path = '/path/to/data'
79
+ # config.logger = Logger.new(STDOUT)
80
+ # end
81
+ class Configuration
82
+ attr_accessor :ontology_path, :data_path, :logger
83
+
84
+ def initialize
85
+ @ontology_path = Openphar.ontology_path
86
+ @data_path = Openphar.data_path
87
+ @logger = Logger.new($stdout, level: :warn)
88
+ end
89
+ end
90
+ end
91
+
92
+ # Load dependencies (external gems)
93
+ require 'lutaml/model'
94
+ require 'rdf'
95
+ require 'rdf/turtle'
96
+ require 'rdf/json'
97
+ require 'json/ld'
98
+ require 'nokogiri'
99
+ require 'thor'
100
+
101
+ # Load version (direct require, no autoload for constants)
102
+ require_relative 'openphar/version'
103
+
104
+ # Autoload direct children modules (one level deep only)
105
+ # Each module file defines autoload for its own children
106
+ module Openphar
107
+ autoload :Core, 'openphar/core'
108
+ autoload :Models, 'openphar/models'
109
+ autoload :Parsers, 'openphar/parsers'
110
+ autoload :Repositories, 'openphar/repositories'
111
+ autoload :Transformers, 'openphar/transformers'
112
+ autoload :Linkers, 'openphar/linkers'
113
+ autoload :Migrators, 'openphar/migrators'
114
+ autoload :Exporters, 'openphar/exporters'
115
+ autoload :Cli, 'openphar/cli'
116
+ autoload :Errors, 'openphar/errors'
117
+ autoload :MonographMerger, 'openphar/monograph_merger'
118
+ autoload :Registry, 'openphar/registry'
119
+ end
@@ -0,0 +1,267 @@
1
+ # Open Pharmacopoeia - Bibliographic Ontology
2
+ #
3
+ # This module defines classes and properties for tracking pharmacopoeia
4
+ # editions, supplements, and version history.
5
+ #
6
+ # Classes:
7
+ # - Edition: A specific edition of a pharmacopoeia publication
8
+ # - Supplement: A supplement to a pharmacopoeia edition
9
+ # - VersionHistory: Version tracking for monographs
10
+ #
11
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
12
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
13
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
14
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
15
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
16
+ @prefix dct: <http://purl.org/dc/terms/> .
17
+ @prefix op: <https://www.openphar.org/ontology/core/> .
18
+ @prefix bib: <https://www.openphar.org/ontology/bibliographic/> .
19
+
20
+ <https://www.openphar.org/ontology/bibliographic/>
21
+ a owl:Ontology ;
22
+ rdfs:label "Open Pharmacopoeia Bibliographic Ontology"@en ;
23
+ rdfs:comment "Ontology for tracking pharmacopoeia editions, supplements, and version history."@en ;
24
+ owl:imports <https://www.openphar.org/ontology/core/> ;
25
+ dct:created "2025-02-25"^^xsd:date ;
26
+ dct:modified "2025-02-25"^^xsd:date .
27
+
28
+ # =============================================================================
29
+ # EDITION CLASS
30
+ # =============================================================================
31
+
32
+ bib:Edition
33
+ a owl:Class ;
34
+ rdfs:label "Pharmacopoeia Edition"@en ;
35
+ rdfs:comment "A specific edition of a pharmacopoeia publication, such as JP18 or Ph.Int.13."@en ;
36
+ rdfs:subClassOf [
37
+ a owl:Restriction ;
38
+ owl:onProperty bib:editionNumber ;
39
+ owl:minCardinality 1
40
+ ] ;
41
+ rdfs:subClassOf [
42
+ a owl:Restriction ;
43
+ owl:onProperty bib:hasPublisher ;
44
+ owl:cardinality 1
45
+ ] .
46
+
47
+ # Edition properties
48
+
49
+ bib:editionNumber
50
+ a owl:DatatypeProperty ;
51
+ rdfs:label "edition number"@en ;
52
+ rdfs:comment "The edition number as a string (e.g., '18', '13')."@en ;
53
+ rdfs:domain bib:Edition ;
54
+ rdfs:range xsd:string .
55
+
56
+ bib:editionLabel
57
+ a owl:DatatypeProperty ;
58
+ rdfs:label "edition label"@en ;
59
+ rdfs:comment "A human-readable label for the edition (e.g., 'Japanese Pharmacopoeia 18th Edition')."@en ;
60
+ rdfs:domain bib:Edition ;
61
+ rdfs:range rdf:langString .
62
+
63
+ bib:publicationDate
64
+ a owl:DatatypeProperty ;
65
+ rdfs:label "publication date"@en ;
66
+ rdfs:comment "The date when the edition was officially published."@en ;
67
+ rdfs:domain bib:Edition ;
68
+ rdfs:range xsd:date .
69
+
70
+ bib:effectiveDate
71
+ a owl:DatatypeProperty ;
72
+ rdfs:label "effective date"@en ;
73
+ rdfs:comment "The date when the edition becomes officially effective."@en ;
74
+ rdfs:domain bib:Edition ;
75
+ rdfs:range xsd:date .
76
+
77
+ bib:hasPublisher
78
+ a owl:ObjectProperty ;
79
+ rdfs:label "has publisher"@en ;
80
+ rdfs:comment "The pharmacopoeia publisher of this edition."@en ;
81
+ rdfs:domain bib:Edition ;
82
+ rdfs:range op:Publisher .
83
+
84
+ bib:hasSupplement
85
+ a owl:ObjectProperty ;
86
+ rdfs:label "has supplement"@en ;
87
+ rdfs:comment "A supplement to this edition."@en ;
88
+ rdfs:domain bib:Edition ;
89
+ rdfs:range bib:Supplement .
90
+
91
+ bib:containsMonograph
92
+ a owl:ObjectProperty ;
93
+ rdfs:label "contains monograph"@en ;
94
+ rdfs:comment "A monograph included in this edition."@en ;
95
+ rdfs:domain bib:Edition ;
96
+ rdfs:range op:PharmacopoeiaMonograph .
97
+
98
+ bib:monographCount
99
+ a owl:DatatypeProperty ;
100
+ rdfs:label "monograph count"@en ;
101
+ rdfs:comment "The total number of monographs in this edition."@en ;
102
+ rdfs:domain bib:Edition ;
103
+ rdfs:range xsd:integer .
104
+
105
+ bib:officialLanguage
106
+ a owl:DatatypeProperty ;
107
+ rdfs:label "official language"@en ;
108
+ rdfs:comment "The official language(s) of the edition."@en ;
109
+ rdfs:domain bib:Edition ;
110
+ rdfs:range xsd:string .
111
+
112
+ bib:editionUrl
113
+ a owl:DatatypeProperty ;
114
+ rdfs:label "edition URL"@en ;
115
+ rdfs:comment "The official URL where the edition can be accessed."@en ;
116
+ rdfs:domain bib:Edition ;
117
+ rdfs:range xsd:anyURI .
118
+
119
+ # =============================================================================
120
+ # SUPPLEMENT CLASS
121
+ # =============================================================================
122
+
123
+ bib:Supplement
124
+ a owl:Class ;
125
+ rdfs:label "Pharmacopoeia Supplement"@en ;
126
+ rdfs:comment "A supplement to a pharmacopoeia edition containing additions, revisions, or deletions."@en ;
127
+ rdfs:subClassOf [
128
+ a owl:Restriction ;
129
+ owl:onProperty bib:supplementNumber ;
130
+ owl:minCardinality 1
131
+ ] ;
132
+ rdfs:subClassOf [
133
+ a owl:Restriction ;
134
+ owl:onProperty bib:supplementTo ;
135
+ owl:cardinality 1
136
+ ] .
137
+
138
+ # Supplement properties
139
+
140
+ bib:supplementNumber
141
+ a owl:DatatypeProperty ;
142
+ rdfs:label "supplement number"@en ;
143
+ rdfs:comment "The supplement number (e.g., '1', '2')."@en ;
144
+ rdfs:domain bib:Supplement ;
145
+ rdfs:range xsd:string .
146
+
147
+ bib:supplementTo
148
+ a owl:ObjectProperty ;
149
+ rdfs:label "supplement to"@en ;
150
+ rdfs:comment "The edition this supplement applies to."@en ;
151
+ rdfs:domain bib:Supplement ;
152
+ rdfs:range bib:Edition .
153
+
154
+ bib:supplementPublicationDate
155
+ a owl:DatatypeProperty ;
156
+ rdfs:label "supplement publication date"@en ;
157
+ rdfs:comment "The date when the supplement was published."@en ;
158
+ rdfs:domain bib:Supplement ;
159
+ rdfs:range xsd:date .
160
+
161
+ bib:supplementEffectiveDate
162
+ a owl:DatatypeProperty ;
163
+ rdfs:label "supplement effective date"@en ;
164
+ rdfs:comment "The date when the supplement becomes effective."@en ;
165
+ rdfs:domain bib:Supplement ;
166
+ rdfs:range xsd:date .
167
+
168
+ bib:addsMonograph
169
+ a owl:ObjectProperty ;
170
+ rdfs:label "adds monograph"@en ;
171
+ rdfs:comment "A monograph added by this supplement."@en ;
172
+ rdfs:domain bib:Supplement ;
173
+ rdfs:range op:PharmacopoeiaMonograph .
174
+
175
+ bib:revisesMonograph
176
+ a owl:ObjectProperty ;
177
+ rdfs:label "revises monograph"@en ;
178
+ rdfs:comment "A monograph revised by this supplement."@en ;
179
+ rdfs:domain bib:Supplement ;
180
+ rdfs:range op:PharmacopoeiaMonograph .
181
+
182
+ bib:deletesMonograph
183
+ a owl:ObjectProperty ;
184
+ rdfs:label "deletes monograph"@en ;
185
+ rdfs:comment "A monograph deleted by this supplement."@en ;
186
+ rdfs:domain bib:Supplement ;
187
+ rdfs:range op:PharmacopoeiaMonograph .
188
+
189
+ # =============================================================================
190
+ # VERSION HISTORY CLASS
191
+ # =============================================================================
192
+
193
+ bib:VersionHistory
194
+ a owl:Class ;
195
+ rdfs:label "Version History"@en ;
196
+ rdfs:comment "A record of version changes for a monograph across editions and supplements."@en .
197
+
198
+ # Version history properties
199
+
200
+ bib:versionFor
201
+ a owl:ObjectProperty ;
202
+ rdfs:label "version for"@en ;
203
+ rdfs:comment "The monograph this version history tracks."@en ;
204
+ rdfs:domain bib:VersionHistory ;
205
+ rdfs:range op:PharmacopoeiaMonograph .
206
+
207
+ bib:hasVersion
208
+ a owl:ObjectProperty ;
209
+ rdfs:label "has version"@en ;
210
+ rdfs:comment "A specific version entry in the history."@en ;
211
+ rdfs:domain bib:VersionHistory ;
212
+ rdfs:range bib:MonographVersion .
213
+
214
+ bib:MonographVersion
215
+ a owl:Class ;
216
+ rdfs:label "Monograph Version"@en ;
217
+ rdfs:comment "A specific version of a monograph in an edition or supplement."@en .
218
+
219
+ bib:inEdition
220
+ a owl:ObjectProperty ;
221
+ rdfs:label "in edition"@en ;
222
+ rdfs:comment "The edition or supplement containing this version."@en ;
223
+ rdfs:domain bib:MonographVersion ;
224
+ rdfs:range bib:Edition .
225
+
226
+ bib:changeType
227
+ a owl:ObjectProperty ;
228
+ rdfs:label "change type"@en ;
229
+ rdfs:comment "The type of change (new, revised, deleted, unchanged)."@en ;
230
+ rdfs:domain bib:MonographVersion ;
231
+ rdfs:range bib:ChangeType .
232
+
233
+ bib:ChangeType
234
+ a owl:Class ;
235
+ rdfs:label "Change Type"@en ;
236
+ rdfs:comment "The type of change for a monograph version."@en .
237
+
238
+ bib:NewMonograph
239
+ a bib:ChangeType ;
240
+ rdfs:label "New Monograph"@en ;
241
+ skos:prefLabel "New"@en .
242
+
243
+ bib:RevisedMonograph
244
+ a bib:ChangeType ;
245
+ rdfs:label "Revised Monograph"@en ;
246
+ skos:prefLabel "Revised"@en .
247
+
248
+ bib:DeletedMonograph
249
+ a bib:ChangeType ;
250
+ rdfs:label "Deleted Monograph"@en ;
251
+ skos:prefLabel "Deleted"@en .
252
+
253
+ bib:UnchangedMonograph
254
+ a bib:ChangeType ;
255
+ rdfs:label "Unchanged Monograph"@en ;
256
+ skos:prefLabel "Unchanged"@en .
257
+
258
+ # =============================================================================
259
+ # MONOGRAPH TO EDITION LINKING PROPERTY
260
+ # =============================================================================
261
+
262
+ op:belongsToEdition
263
+ a owl:ObjectProperty ;
264
+ rdfs:label "belongs to edition"@en ;
265
+ rdfs:comment "The pharmacopoeia edition this monograph belongs to."@en ;
266
+ rdfs:domain op:PharmacopoeiaMonograph ;
267
+ rdfs:range bib:Edition .
@@ -0,0 +1,69 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@base": "https://www.openphar.org/data/chp/",
5
+ "@vocab": "https://www.openphar.org/ontology/publisher/chp/",
6
+
7
+ "op": "https://www.openphar.org/ontology/core/",
8
+ "chp": "https://www.openphar.org/ontology/publisher/chp/",
9
+ "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
10
+ "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
11
+ "owl": "http://www.w3.org/2002/07/owl#",
12
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
13
+ "skos": "http://www.w3.org/2004/02/skos/core#",
14
+ "dct": "http://purl.org/dc/terms/",
15
+
16
+ "Monograph": { "@id": "chp:Monograph" },
17
+ "TcmCrudeDrug": { "@id": "chp:TcmCrudeDrug" },
18
+ "TcmExtract": { "@id": "chp:TcmExtract" },
19
+ "TcmFormulation": { "@id": "chp:TcmFormulation" },
20
+ "ChemicalSubstance": { "@id": "chp:ChemicalSubstance" },
21
+ "ChemicalPreparation": { "@id": "chp:ChemicalPreparation" },
22
+ "Biologic": { "@id": "chp:Biologic" },
23
+ "GeneralChapter": { "@id": "chp:GeneralChapter" },
24
+ "Section": { "@id": "chp:Section" },
25
+
26
+ "entryId": { "@id": "chp:entryId", "@type": "xsd:integer" },
27
+ "bookId": { "@id": "chp:bookId", "@type": "xsd:integer" },
28
+ "bookName": { "@id": "chp:bookName", "@type": "xsd:string" },
29
+ "directoryId": { "@id": "chp:directoryId", "@type": "xsd:integer" },
30
+ "directoryTitle":{ "@id": "chp:directoryTitle","@type": "xsd:string" },
31
+ "pinyinTitle": { "@id": "chp:pinyinTitle", "@type": "xsd:string" },
32
+ "eTitle": { "@id": "chp:eTitle", "@type": "xsd:string" },
33
+ "pageNum": { "@id": "chp:pageNum", "@type": "xsd:integer" },
34
+ "htmlContent": { "@id": "chp:htmlContent", "@type": "xsd:string" },
35
+ "partTitles": { "@id": "chp:partTitle", "@type": "xsd:string", "@container": "@set" },
36
+ "visitCount": { "@id": "chp:visitCount", "@type": "xsd:integer" },
37
+ "fetchedAt": { "@id": "dct:issued", "@type": "xsd:dateTime" },
38
+
39
+ "section": {
40
+ "@id": "chp:hasSection",
41
+ "@type": "@id",
42
+ "@container": "@set",
43
+ "@context": {
44
+ "@version": 1.1,
45
+ "@vocab": "https://www.openphar.org/ontology/publisher/chp/",
46
+ "sectionName": { "@id": "chp:sectionName", "@type": "xsd:string" },
47
+ "sequence": { "@id": "chp:sequence", "@type": "xsd:integer" },
48
+ "htmlContent": { "@id": "chp:htmlContent", "@type": "xsd:string" },
49
+ "textContent": { "@id": "chp:textContent", "@type": "xsd:string" }
50
+ }
51
+ },
52
+
53
+ "slug": { "@id": "chp:slug", "@type": "xsd:string" },
54
+ "wireKey": { "@id": "chp:wireKey", "@type": "xsd:string" },
55
+
56
+ "title": "dct:title",
57
+ "prefLabel": "skos:prefLabel",
58
+ "publisher": "dct:publisher",
59
+ "edition": { "@id": "op:editionLabel", "@type": "xsd:string" },
60
+ "monographId": { "@id": "op:monographId", "@type": "xsd:string" },
61
+ "belongsToEdition": { "@id": "op:belongsToEdition", "@type": "@id" },
62
+ "definition": "skos:definition",
63
+ "status": { "@id": "op:status", "@type": "xsd:string" },
64
+ "sameSubstanceAs": { "@id": "op:sameSubstanceAs", "@type": "@id", "@container": "@set" },
65
+
66
+ "id": "@id",
67
+ "type": "@type"
68
+ }
69
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "@context": {
3
+ "@import": "https://www.openphar.org/ontology/context/pharmacopoeia.jsonld",
4
+ "@base": "https://www.openphar.org/data/monograph/",
5
+
6
+ "CrudeDrugMonograph": {
7
+ "@id": "op:CrudeDrugMonograph",
8
+ "@context": {
9
+ "botanicalSource": {
10
+ "@id": "op:botanicalSource",
11
+ "@type": "@id",
12
+ "@context": {
13
+ "referencesPlantSpecies": {
14
+ "@id": "op:referencesPlantSpecies",
15
+ "@type": "@id"
16
+ },
17
+ "plantPartUsed": { "@id": "op:plantPartUsed", "@container": "@language" },
18
+ "collectionPeriod": { "@id": "op:collectionPeriod", "@container": "@language" }
19
+ }
20
+ },
21
+ "macroscopicDescription": {
22
+ "@id": "op:macroscopicDescription",
23
+ "@type": "@id",
24
+ "@context": {
25
+ "color": { "@id": "op:color", "@container": "@language" },
26
+ "shape": { "@id": "op:shape", "@container": "@language" },
27
+ "size": { "@id": "op:size", "@container": "@language" },
28
+ "texture": { "@id": "op:texture", "@container": "@language" },
29
+ "odor": { "@id": "op:odor", "@container": "@language" },
30
+ "taste": { "@id": "op:taste", "@container": "@language" },
31
+ "fracture": { "@id": "op:fracture", "@container": "@language" }
32
+ }
33
+ },
34
+ "microscopicDescription": {
35
+ "@id": "op:microscopicDescription",
36
+ "@type": "@id",
37
+ "@context": {
38
+ "transverseSection": { "@id": "op:transverseSection", "@container": "@language" },
39
+ "powderCharacteristics": { "@id": "op:powderCharacteristics", "@container": "@language" },
40
+ "diagnosticFeatures": { "@id": "op:diagnosticFeatures", "@container": "@language" }
41
+ }
42
+ }
43
+ }
44
+ },
45
+
46
+ "extractiveTests": {
47
+ "@id": "op:extractiveTests",
48
+ "@container": "@set"
49
+ },
50
+
51
+ "AlcoholSolubleExtractive": { "@id": "method:AlcoholSolubleExtractive", "@type": "@id" },
52
+ "WaterSolubleExtractive": { "@id": "method:WaterSolubleExtractive", "@type": "@id" },
53
+ "DiluteAlcoholSolubleExtractive": { "@id": "method:DiluteAlcoholSolubleExtractive", "@type": "@id" },
54
+ "EtherSolubleExtractive": { "@id": "method:EtherSolubleExtractive", "@type": "@id" }
55
+ }
56
+ }