openphar 0.2.0 → 0.3.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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openphar/models/ahp/formulation.rb +29 -0
  3. data/lib/openphar/models/ahp/herbal_monograph.rb +43 -0
  4. data/lib/openphar/models/ahp/monograph.rb +9 -7
  5. data/lib/openphar/models/ahp.rb +4 -9
  6. data/lib/openphar/models/api/bhasma.rb +44 -0
  7. data/lib/openphar/models/api/dravya.rb +62 -0
  8. data/lib/openphar/models/api/formulation.rb +31 -0
  9. data/lib/openphar/models/api/monograph.rb +13 -7
  10. data/lib/openphar/models/api.rb +5 -10
  11. data/lib/openphar/models/hkcmms/tcm_crude_drug.rb +43 -0
  12. data/lib/openphar/models/hkcmms/tcm_formulation.rb +31 -0
  13. data/lib/openphar/models/hkcmms.rb +5 -10
  14. data/lib/openphar/models/jp/crude_drug.rb +18 -1
  15. data/lib/openphar/models/jp/powdered_crude_drug.rb +28 -0
  16. data/lib/openphar/models/jp.rb +3 -12
  17. data/lib/openphar/models/monograph.rb +28 -0
  18. data/lib/openphar/models/thp/cannabis_monograph.rb +39 -0
  19. data/lib/openphar/models/thp/herbal_monograph.rb +33 -0
  20. data/lib/openphar/models/thp.rb +4 -9
  21. data/lib/openphar/version.rb +1 -1
  22. data/ontology/context/ahp.jsonld +20 -0
  23. data/ontology/context/api.jsonld +20 -0
  24. data/ontology/context/hkcmms.jsonld +20 -0
  25. data/ontology/context/jp.jsonld +20 -0
  26. data/ontology/context/thp.jsonld +20 -0
  27. data/ontology/publisher/ahp/extensions.ttl +30 -0
  28. data/ontology/publisher/api/extensions.ttl +38 -0
  29. data/ontology/publisher/hkcmms/extensions.ttl +31 -0
  30. data/ontology/publisher/jp/extensions.ttl +40 -0
  31. data/ontology/publisher/thp/extensions.ttl +28 -0
  32. data/shapes/ahp/monograph.ttl +28 -0
  33. data/shapes/api/monograph.ttl +28 -0
  34. data/shapes/hkcmms/monograph.ttl +28 -0
  35. data/shapes/jp/monograph.ttl +28 -0
  36. data/shapes/phint/monograph.ttl +15 -0
  37. data/shapes/thp/monograph.ttl +28 -0
  38. metadata +27 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dd4f17d1b59a9bdc713b0fa937db90801e73d0f55d9cb24004896d7bb66ea34
4
- data.tar.gz: c502340959befd898a1d5c9cbad4378d66641249727f3e1389e57f814a33507a
3
+ metadata.gz: d35db752ba7a2c40757ca084fb31fdb95f519c1a4cdc5fca9197b6798a9b426f
4
+ data.tar.gz: a987b5e0709dcad7573af2e76a54c1e906a59492b9ac0cec394769448cd15880
5
5
  SHA512:
6
- metadata.gz: e8c67e7a899c88463d3d9e9e999c719b3983d9f2453694aac56d828245bcf4368246830131749442752c3ace8ab66228625b704b3eb1596a157272016bd2b164
7
- data.tar.gz: 83e18e3668f09cc0e6fa430e81687a8cb96bddf3f4f7fb779eb93f2b3eaef991cea9608b539163311fc0d67e5b99ad7e955e3ed0d70d3a21b2efecc044d1b0c6
6
+ metadata.gz: 34a0338ab86fa45a258b3084a694242eec59ca8578960788078f3f4d3afe6c1c6e814d5117e3e3c211658c996c7bc4bd8faae6d378dd206aaea163b21a707b2b
7
+ data.tar.gz: 47235f7908eb73956a0f553f985c4b5fbf162589f634a3fccecdf9ea0df82a7b3edd02a1257dfebf1d2340df3bed462d1e6738f1a7c0d1b1b5946d9566519348
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module AHP
6
+ # AHP finished-product formulation monograph.
7
+ #
8
+ class Formulation < Monograph
9
+ attribute :ingredients, :hash, collection: true, default: []
10
+ attribute :dosage_form, :string
11
+ attribute :adult_dose, :string
12
+ attribute :indications, :string, collection: true, default: []
13
+
14
+ json do
15
+ map 'ingredients', to: :ingredients
16
+ map 'dosageForm', to: :dosage_form
17
+ map 'adultDose', to: :adult_dose
18
+ map 'indications', to: :indications
19
+ end
20
+
21
+ class << self
22
+ def wire_key = 'formulation'
23
+ def harmonized_type = 'Formulation'
24
+ def jsonld_type = 'AhpFormulation'
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module AHP
6
+ # AHP crude drug (herbal substance) monograph.
7
+ #
8
+ class HerbalMonograph < Monograph
9
+ attribute :parts_used, :string, collection: true, default: []
10
+ attribute :botanical_description, :hash, default: {}
11
+ attribute :constituents, :hash, default: {}
12
+ attribute :therapeutic_actions, :string, collection: true, default: []
13
+ attribute :clinical_evidence, :hash, default: {}
14
+ attribute :safety_rating, :string
15
+ attribute :contraindications, :string, collection: true, default: []
16
+ attribute :drug_interactions, :string, collection: true, default: []
17
+ attribute :side_effects, :string, collection: true, default: []
18
+ attribute :dosage_forms, :string, collection: true, default: []
19
+ attribute :adult_dose, :string
20
+
21
+ json do
22
+ map 'partsUsed', to: :parts_used
23
+ map 'botanicalDescription', to: :botanical_description
24
+ map 'constituents', to: :constituents
25
+ map 'therapeuticActions', to: :therapeutic_actions
26
+ map 'clinicalEvidence', to: :clinical_evidence
27
+ map 'safetyRating', to: :safety_rating
28
+ map 'contraindications', to: :contraindications
29
+ map 'drugInteractions', to: :drug_interactions
30
+ map 'sideEffects', to: :side_effects
31
+ map 'dosageForms', to: :dosage_forms
32
+ map 'adultDose', to: :adult_dose
33
+ end
34
+
35
+ class << self
36
+ def wire_key = 'herbal_monograph'
37
+ def harmonized_type = 'CrudeDrug'
38
+ def jsonld_type = 'AhpHerbalMonograph'
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -3,24 +3,26 @@
3
3
  module Openphar
4
4
  module Models
5
5
  module AHP
6
- # American Herbal Pharmacopoeia monograph (base + stub).
6
+ # Base class for American Herbal Pharmacopoeia monographs.
7
7
  #
8
- # AHP-specific therapeutic/safety profiles are deferred; this class
9
- # exists so AHP records classify and serialize through the standard
10
- # openphar pipeline today.
8
+ # AHP monographs carry the most extensive botanical and clinical
9
+ # evidence of any pharmacopoeia, including safety ratings and
10
+ # contraindications.
11
11
  #
12
12
  class Monograph < Openphar::Models::Monograph
13
- attribute :western_herb_name, :string
13
+ attribute :common_name, :string
14
14
  attribute :latin_name, :string
15
+ attribute :family, :string
15
16
 
16
17
  json do
17
- map 'westernHerbName', to: :western_herb_name
18
+ map 'commonName', to: :common_name
18
19
  map 'latinName', to: :latin_name
20
+ map 'family', to: :family
19
21
  end
20
22
 
21
23
  class << self
22
24
  def wire_key = 'monograph'
23
- def harmonized_type = 'CrudeDrug'
25
+ def harmonized_type = nil
24
26
  def jsonld_type = 'AhpMonograph'
25
27
  end
26
28
  end
@@ -3,15 +3,10 @@
3
3
  module Openphar
4
4
  module Models
5
5
  # American Herbal Pharmacopoeia (AHP) specific models.
6
- #
7
- # Contains models unique to the American Herbal Pharmacopoeia:
8
- #
9
- # @example
10
- # # Access AHP models
11
- # Openphar::Models::AHP::HerbalMonograph
12
- #
13
- # @see https://www.herbal-ahp.org/
14
6
  module AHP
15
- autoload :Monograph, 'openphar/models/ahp/monograph' end
7
+ autoload :Monograph, "openphar/models/ahp/monograph"
8
+ autoload :HerbalMonograph, "openphar/models/ahp/herbal_monograph"
9
+ autoload :Formulation, "openphar/models/ahp/formulation"
10
+ end
16
11
  end
17
12
  end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module API
6
+ # Bhasma — Ayurvedic processed-mineral / metal preparation.
7
+ #
8
+ # Bhasmas are unique to Ayurvedic medicine: a mineral or metal is
9
+ # repeatedly calcined with herbal juices to produce an ash with
10
+ # therapeutic properties. Carries Rasa/Guna/Virya/Vipaka/Karma like
11
+ # a Dravya but with mineral-specific source + preparation method.
12
+ #
13
+ class Bhasma < Monograph
14
+ attribute :source_mineral, :string
15
+ attribute :purification_method, :string
16
+ attribute :preparation_method, :string
17
+ attribute :rasa, :string, collection: true, default: []
18
+ attribute :guna, :string, collection: true, default: []
19
+ attribute :virya, :string
20
+ attribute :vipaka, :string
21
+ attribute :karma, :string, collection: true, default: []
22
+ attribute :dose, :string
23
+
24
+ json do
25
+ map 'sourceMineral', to: :source_mineral
26
+ map 'purificationMethod', to: :purification_method
27
+ map 'preparationMethod', to: :preparation_method
28
+ map 'rasa', to: :rasa
29
+ map 'guna', to: :guna
30
+ map 'virya', to: :virya
31
+ map 'vipaka', to: :vipaka
32
+ map 'karma', to: :karma
33
+ map 'dose', to: :dose
34
+ end
35
+
36
+ class << self
37
+ def wire_key = 'bhasma'
38
+ def harmonized_type = 'MineralSubstance'
39
+ def jsonld_type = 'ApiBhasma'
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module API
6
+ # Ayurvedic plant-substance monograph (Dravya).
7
+ #
8
+ # Dravya = "substance" in Ayurveda. Carries the full Ayurvedic
9
+ # pharmacognostic profile: Panchakarma properties (Rasa/Guna/Virya/
10
+ # Vipaka/Karma), purity limits, constituents, dose.
11
+ #
12
+ # Mirrors the structure of `data-india-ayurvedic-pharmacopoeia/
13
+ # sample-monograph.md`.
14
+ #
15
+ class Dravya < Monograph
16
+ attribute :plant_part, :string
17
+ attribute :macroscopic_description, :hash, default: {}
18
+ attribute :microscopic_description, :hash, default: {}
19
+ attribute :foreign_matter_limit, :string
20
+ attribute :total_ash_limit, :string
21
+ attribute :acid_insoluble_ash_limit, :string
22
+ attribute :alcohol_soluble_extractive, :string
23
+ attribute :water_soluble_extractive, :string
24
+ attribute :constituents, :string, collection: true, default: []
25
+ attribute :rasa, :string, collection: true, default: []
26
+ attribute :guna, :string, collection: true, default: []
27
+ attribute :virya, :string
28
+ attribute :vipaka, :string
29
+ attribute :karma, :string, collection: true, default: []
30
+ attribute :important_formulations, :string, collection: true, default: []
31
+ attribute :therapeutic_uses, :string, collection: true, default: []
32
+ attribute :dose, :string
33
+
34
+ json do
35
+ map 'plantPart', to: :plant_part
36
+ map 'macroscopicDescription', to: :macroscopic_description
37
+ map 'microscopicDescription', to: :microscopic_description
38
+ map 'foreignMatterLimit', to: :foreign_matter_limit
39
+ map 'totalAshLimit', to: :total_ash_limit
40
+ map 'acidInsolubleAshLimit', to: :acid_insoluble_ash_limit
41
+ map 'alcoholSolubleExtractive', to: :alcohol_soluble_extractive
42
+ map 'waterSolubleExtractive', to: :water_soluble_extractive
43
+ map 'constituents', to: :constituents
44
+ map 'rasa', to: :rasa
45
+ map 'guna', to: :guna
46
+ map 'virya', to: :virya
47
+ map 'vipaka', to: :vipaka
48
+ map 'karma', to: :karma
49
+ map 'importantFormulations', to: :important_formulations
50
+ map 'therapeuticUses', to: :therapeutic_uses
51
+ map 'dose', to: :dose
52
+ end
53
+
54
+ class << self
55
+ def wire_key = 'dravya'
56
+ def harmonized_type = 'CrudeDrug'
57
+ def jsonld_type = 'ApiDravya'
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module API
6
+ # Classical Ayurvedic formulation (Asava, Arishta, Bhasma, Churna, etc.)
7
+ #
8
+ class Formulation < Monograph
9
+ attribute :ingredients, :hash, collection: true, default: []
10
+ attribute :method_of_preparation, :string
11
+ attribute :anupana, :string
12
+ attribute :dose, :string
13
+ attribute :indications, :string, collection: true, default: []
14
+
15
+ json do
16
+ map 'ingredients', to: :ingredients
17
+ map 'methodOfPreparation', to: :method_of_preparation
18
+ map 'anupana', to: :anupana
19
+ map 'dose', to: :dose
20
+ map 'indications', to: :indications
21
+ end
22
+
23
+ class << self
24
+ def wire_key = 'formulation'
25
+ def harmonized_type = 'Formulation'
26
+ def jsonld_type = 'ApiFormulation'
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -3,24 +3,30 @@
3
3
  module Openphar
4
4
  module Models
5
5
  module API
6
- # Ayurvedic Pharmacopoeia of India monograph (base + stub).
6
+ # Base class for Ayurvedic Pharmacopoeia of India monographs.
7
7
  #
8
- # Ayurveda-specific properties (rasa, guna, virya, vipaka, karma) are
9
- # deferred; this class exists so API records classify and serialize
10
- # through the standard openphar pipeline today.
8
+ # Carries multi-language identity (Sanskrit, English, Latin, plus
9
+ # regional Indian-language synonyms API monographs typically list
10
+ # 13+ language variants per plant).
11
11
  #
12
12
  class Monograph < Openphar::Models::Monograph
13
13
  attribute :sanskrit_name, :string
14
- attribute :ayurvedic_category, :string
14
+ attribute :english_name, :string
15
+ attribute :latin_name, :string
16
+ attribute :family, :string
17
+ attribute :synonyms, :hash, default: {}
15
18
 
16
19
  json do
17
20
  map 'sanskritName', to: :sanskrit_name
18
- map 'ayurvedicCategory', to: :ayurvedic_category
21
+ map 'englishName', to: :english_name
22
+ map 'latinName', to: :latin_name
23
+ map 'family', to: :family
24
+ map 'synonyms', to: :synonyms
19
25
  end
20
26
 
21
27
  class << self
22
28
  def wire_key = 'monograph'
23
- def harmonized_type = 'CrudeDrug'
29
+ def harmonized_type = nil
24
30
  def jsonld_type = 'ApiMonograph'
25
31
  end
26
32
  end
@@ -3,16 +3,11 @@
3
3
  module Openphar
4
4
  module Models
5
5
  # Ayurvedic Pharmacopoeia of India (API) specific models.
6
- #
7
- # Contains models unique to the Ayurvedic Pharmacopoeia of India:
8
- #
9
- # @example
10
- # # Access API models
11
- # Openphar::Models::API::DravyaMonograph
12
- # Openphar::Models::API::AyurvedicFormula
13
- #
14
- # @see https://main.ayush.gov.in/
15
6
  module API
16
- autoload :Monograph, 'openphar/models/api/monograph' end
7
+ autoload :Monograph, "openphar/models/api/monograph"
8
+ autoload :Dravya, "openphar/models/api/dravya"
9
+ autoload :Formulation, "openphar/models/api/formulation"
10
+ autoload :Bhasma, "openphar/models/api/bhasma"
11
+ end
17
12
  end
18
13
  end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module HKCMMS
6
+ # HKCMMS TCM crude drug monograph.
7
+ #
8
+ # Carries the four classical TCM pharmacological properties:
9
+ # nature (四气), flavor (五味), meridian tropism (归经), plus
10
+ # TCM functions (功效) and indications (主治).
11
+ #
12
+ class TcmCrudeDrug < Monograph
13
+ attribute :nature, :string, collection: true, default: [] # 四气: cold/cool/neutral/warm/hot
14
+ attribute :flavor, :string, collection: true, default: [] # 五味: sweet/sour/bitter/pungent/salty
15
+ attribute :meridian_tropism, :string, collection: true, default: [] # 归经
16
+ attribute :functions, :string, collection: true, default: [] # 功效
17
+ attribute :indications, :string, collection: true, default: [] # 主治
18
+ attribute :botanical_source, :hash, default: {}
19
+ attribute :parts_used, :string, collection: true, default: []
20
+ attribute :constituents, :hash, default: {}
21
+ attribute :dosage, :string
22
+
23
+ json do
24
+ map 'nature', to: :nature
25
+ map 'flavor', to: :flavor
26
+ map 'meridianTropism', to: :meridian_tropism
27
+ map 'functions', to: :functions
28
+ map 'indications', to: :indications
29
+ map 'botanicalSource', to: :botanical_source
30
+ map 'partsUsed', to: :parts_used
31
+ map 'constituents', to: :constituents
32
+ map 'dosage', to: :dosage
33
+ end
34
+
35
+ class << self
36
+ def wire_key = 'tcm_crude_drug'
37
+ def harmonized_type = 'CrudeDrug'
38
+ def jsonld_type = 'HkcmmsTcmCrudeDrug'
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module HKCMMS
6
+ # HKCMMS classical TCM formulation (方剂).
7
+ #
8
+ class TcmFormulation < Monograph
9
+ attribute :ingredients, :hash, collection: true, default: []
10
+ attribute :method_of_preparation, :string
11
+ attribute :dosage, :string
12
+ attribute :indications, :string, collection: true, default: []
13
+ attribute :contraindications, :string, collection: true, default: []
14
+
15
+ json do
16
+ map 'ingredients', to: :ingredients
17
+ map 'methodOfPreparation', to: :method_of_preparation
18
+ map 'dosage', to: :dosage
19
+ map 'indications', to: :indications
20
+ map 'contraindications', to: :contraindications
21
+ end
22
+
23
+ class << self
24
+ def wire_key = 'tcm_formulation'
25
+ def harmonized_type = 'Formulation'
26
+ def jsonld_type = 'HkcmmsTcmFormulation'
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -2,16 +2,11 @@
2
2
 
3
3
  module Openphar
4
4
  module Models
5
- # Hong Kong Chinese Medicine (HKCMMS) specific models.
6
- #
7
- # Contains models unique to the Hong Kong Chinese Materia Medica Standards:
8
- #
9
- # @example
10
- # # Access HKCMMS models
11
- # Openphar::Models::HKCMMS::TcmMonograph
12
- #
13
- # @see https://www.cmchk.org.hk/
5
+ # Hong Kong Chinese Materia Medica Standards (HKCMMS) specific models.
14
6
  module HKCMMS
15
- autoload :Monograph, 'openphar/models/hkcmms/monograph' end
7
+ autoload :Monograph, "openphar/models/hkcmms/monograph"
8
+ autoload :TcmCrudeDrug, "openphar/models/hkcmms/tcm_crude_drug"
9
+ autoload :TcmFormulation, "openphar/models/hkcmms/tcm_formulation"
10
+ end
16
11
  end
17
12
  end
@@ -3,9 +3,26 @@
3
3
  module Openphar
4
4
  module Models
5
5
  module JP
6
- # Crude drug (herbal medicine) monograph.
6
+ # JP-specific crude-drug (herbal) monograph.
7
+ #
8
+ # Carries the botanical source (organism + part used) per JP's
9
+ # `biological_source` shape in `data-japan-pharmacopia/lib/jp_pharmacopoeia/`.
7
10
  #
8
11
  class CrudeDrug < Monograph
12
+ attribute :botanical_source, :hash, default: {}
13
+ attribute :parts_used, :string, collection: true, default: []
14
+ attribute :description, :hash, default: {}
15
+ attribute :identification_tests, :hash, default: {}
16
+ attribute :constituents, :hash, default: {}
17
+
18
+ json do
19
+ map 'botanicalSource', to: :botanical_source
20
+ map 'partsUsed', to: :parts_used
21
+ map 'description', to: :description
22
+ map 'identificationTests', to: :identification_tests
23
+ map 'constituents', to: :constituents
24
+ end
25
+
9
26
  class << self
10
27
  def wire_key = 'crude_drug'
11
28
  def harmonized_type = 'CrudeDrug'
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module JP
6
+ # JP-specific powdered crude drug.
7
+ #
8
+ # JP distinguishes powdered crude drugs from whole crude drugs in
9
+ # its own monograph type — a JP-only distinction. Powdered forms
10
+ # have additional tests (e.g., microscopic identification) that
11
+ # whole crude drugs don't.
12
+ #
13
+ class PowderedCrudeDrug < CrudeDrug
14
+ attribute :microscopic_identification, :hash, default: {}
15
+
16
+ json do
17
+ map 'microscopicIdentification', to: :microscopic_identification
18
+ end
19
+
20
+ class << self
21
+ def wire_key = 'powdered_crude_drug'
22
+ def harmonized_type = 'CrudeDrug'
23
+ def jsonld_type = 'JpPowderedCrudeDrug'
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -3,27 +3,18 @@
3
3
  module Openphar
4
4
  module Models
5
5
  # Japan Pharmacopoeia (JP) specific models.
6
- #
7
- # Contains models unique to the Japanese Pharmacopoeia:
8
- # - Kampo formulas (Japanese traditional medicine formulations)
9
- # - JP-specific monograph extensions
10
- #
11
- # @example
12
- # # Access JP models
13
- # Openphar::Models::JP::KampoFormula
14
- #
15
- # @see https://www.mhlw.go.jp/topics/bukyoku/iyaku/yakkyoku/
16
6
  module JP
17
- # Kampo formulas (Japanese traditional medicine)
18
7
  autoload :KampoFormula, "openphar/models/jp/kampo_formula"
19
8
  autoload :Monograph, "openphar/models/jp/monograph"
20
9
  autoload :CrudeDrug, "openphar/models/jp/crude_drug"
10
+ autoload :PowderedCrudeDrug, "openphar/models/jp/powdered_crude_drug"
21
11
  autoload :ChemicalDrug, "openphar/models/jp/chemical_drug"
22
12
  autoload :Formulation, "openphar/models/jp/formulation"
23
13
  autoload :Biological, "openphar/models/jp/biological"
24
14
  autoload :Excipient, "openphar/models/jp/excipient"
25
15
  autoload :Vitamin, "openphar/models/jp/vitamin"
26
16
  autoload :AminoAcid, "openphar/models/jp/amino_acid"
27
- autoload :Mineral, "openphar/models/jp/mineral" end
17
+ autoload :Mineral, "openphar/models/jp/mineral"
18
+ end
28
19
  end
29
20
  end
@@ -44,6 +44,34 @@ module Openphar
44
44
  def jsonld_type
45
45
  'Monograph'
46
46
  end
47
+
48
+ # Override in subclasses to declare the cross-publisher semantic
49
+ # type (e.g., "CrudeDrug", "ChemicalDrug"). Returns nil when the
50
+ # subclass is publisher-specific with no harmonized equivalent.
51
+ #
52
+ # @return [String, nil]
53
+ def harmonized_type
54
+ nil
55
+ end
56
+
57
+ # Override in subclasses to declare the publisher-specific
58
+ # snake_case routing key (e.g., "tcm_crude_drug", "dravya").
59
+ #
60
+ # @return [String]
61
+ def wire_key
62
+ 'monograph'
63
+ end
64
+
65
+ # Array of types to emit in JSON-LD @type. Computed from
66
+ # harmonized_type + jsonld_type + the base 'Monograph'.
67
+ #
68
+ # @return [Array<String>]
69
+ def jsonld_types
70
+ types = ['Monograph']
71
+ types << harmonized_type if harmonized_type
72
+ types << jsonld_type unless jsonld_type == 'Monograph'
73
+ types.uniq
74
+ end
47
75
  end
48
76
 
49
77
  def iri
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module THP
6
+ # THP-specific cannabis monograph (Thailand legalized cannabis for
7
+ # medical and research use in 2018; the Thai Herbal Pharmacopoeia
8
+ # maintains a distinct monograph type with regulatory-specific fields).
9
+ #
10
+ class CannabisMonograph < Monograph
11
+ attribute :cultivar, :string
12
+ attribute :thc_content, :string # Δ9-THC percent by dry weight
13
+ attribute :cbd_content, :string # CBD percent
14
+ attribute :cbn_content, :string # CBN percent
15
+ attribute :terpene_profile, :hash, default: {}
16
+ attribute :cultivation_license, :string # Thai FDA license category
17
+ attribute :medical_use_category, :string
18
+ attribute :contraindications, :string, collection: true, default: []
19
+
20
+ json do
21
+ map 'cultivar', to: :cultivar
22
+ map 'thcContent', to: :thc_content
23
+ map 'cbdContent', to: :cbd_content
24
+ map 'cbnContent', to: :cbn_content
25
+ map 'terpeneProfile', to: :terpene_profile
26
+ map 'cultivationLicense', to: :cultivation_license
27
+ map 'medicalUseCategory', to: :medical_use_category
28
+ map 'contraindications', to: :contraindications
29
+ end
30
+
31
+ class << self
32
+ def wire_key = 'cannabis_monograph'
33
+ def harmonized_type = 'CrudeDrug'
34
+ def jsonld_type = 'ThpCannabisMonograph'
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Openphar
4
+ module Models
5
+ module THP
6
+ # Standard Thai Herbal Pharmacopoeia crude drug monograph.
7
+ #
8
+ class HerbalMonograph < Monograph
9
+ attribute :plant_part, :string
10
+ attribute :botanical_description, :hash, default: {}
11
+ attribute :constituents, :hash, default: {}
12
+ attribute :uses, :string, collection: true, default: []
13
+ attribute :dose, :string
14
+ attribute :contraindications, :string, collection: true, default: []
15
+
16
+ json do
17
+ map 'plantPart', to: :plant_part
18
+ map 'botanicalDescription', to: :botanical_description
19
+ map 'constituents', to: :constituents
20
+ map 'uses', to: :uses
21
+ map 'dose', to: :dose
22
+ map 'contraindications', to: :contraindications
23
+ end
24
+
25
+ class << self
26
+ def wire_key = 'herbal_monograph'
27
+ def harmonized_type = 'CrudeDrug'
28
+ def jsonld_type = 'ThpHerbalMonograph'
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -3,15 +3,10 @@
3
3
  module Openphar
4
4
  module Models
5
5
  # Thai Herbal Pharmacopoeia (THP) specific models.
6
- #
7
- # Contains models unique to the Thai Herbal Pharmacopoeia:
8
- #
9
- # @example
10
- # # Access THP models
11
- # Openphar::Models::THP::ThaiHerbalMonograph
12
- #
13
- # @see http://www.fda.moph.go.th/
14
6
  module THP
15
- autoload :Monograph, 'openphar/models/thp/monograph' end
7
+ autoload :Monograph, "openphar/models/thp/monograph"
8
+ autoload :HerbalMonograph, "openphar/models/thp/herbal_monograph"
9
+ autoload :CannabisMonograph, "openphar/models/thp/cannabis_monograph"
10
+ end
16
11
  end
17
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Openphar
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -0,0 +1,20 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@base": "https://www.openphar.org/data/ahp/",
5
+ "@vocab": "https://www.openphar.org/ontology/publisher/ahp/",
6
+ "ahp": "https://www.openphar.org/ontology/publisher/ahp/",
7
+ "op": "https://www.openphar.org/ontology/core/",
8
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
9
+ "dct": "http://purl.org/dc/terms/",
10
+ "skos": "http://www.w3.org/2004/02/skos/core#",
11
+ "id": "@id",
12
+ "type": "@type",
13
+ "title": "dct:title",
14
+ "prefLabel": "skos:prefLabel",
15
+ "publisher": "dct:publisher",
16
+ "monographId": { "@id": "op:monographId", "@type": "xsd:string" },
17
+ "belongsToEdition": { "@id": "op:belongsToEdition", "@type": "@id" },
18
+ "sameSubstanceAs": { "@id": "op:sameSubstanceAs", "@type": "@id", "@container": "@set" }
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@base": "https://www.openphar.org/data/api/",
5
+ "@vocab": "https://www.openphar.org/ontology/publisher/api/",
6
+ "api": "https://www.openphar.org/ontology/publisher/api/",
7
+ "op": "https://www.openphar.org/ontology/core/",
8
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
9
+ "dct": "http://purl.org/dc/terms/",
10
+ "skos": "http://www.w3.org/2004/02/skos/core#",
11
+ "id": "@id",
12
+ "type": "@type",
13
+ "title": "dct:title",
14
+ "prefLabel": "skos:prefLabel",
15
+ "publisher": "dct:publisher",
16
+ "monographId": { "@id": "op:monographId", "@type": "xsd:string" },
17
+ "belongsToEdition": { "@id": "op:belongsToEdition", "@type": "@id" },
18
+ "sameSubstanceAs": { "@id": "op:sameSubstanceAs", "@type": "@id", "@container": "@set" }
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@base": "https://www.openphar.org/data/hkcmms/",
5
+ "@vocab": "https://www.openphar.org/ontology/publisher/hkcmms/",
6
+ "hkcmms": "https://www.openphar.org/ontology/publisher/hkcmms/",
7
+ "op": "https://www.openphar.org/ontology/core/",
8
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
9
+ "dct": "http://purl.org/dc/terms/",
10
+ "skos": "http://www.w3.org/2004/02/skos/core#",
11
+ "id": "@id",
12
+ "type": "@type",
13
+ "title": "dct:title",
14
+ "prefLabel": "skos:prefLabel",
15
+ "publisher": "dct:publisher",
16
+ "monographId": { "@id": "op:monographId", "@type": "xsd:string" },
17
+ "belongsToEdition": { "@id": "op:belongsToEdition", "@type": "@id" },
18
+ "sameSubstanceAs": { "@id": "op:sameSubstanceAs", "@type": "@id", "@container": "@set" }
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@base": "https://www.openphar.org/data/jp/",
5
+ "@vocab": "https://www.openphar.org/ontology/publisher/jp/",
6
+ "jp": "https://www.openphar.org/ontology/publisher/jp/",
7
+ "op": "https://www.openphar.org/ontology/core/",
8
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
9
+ "dct": "http://purl.org/dc/terms/",
10
+ "skos": "http://www.w3.org/2004/02/skos/core#",
11
+ "id": "@id",
12
+ "type": "@type",
13
+ "title": "dct:title",
14
+ "prefLabel": "skos:prefLabel",
15
+ "publisher": "dct:publisher",
16
+ "monographId": { "@id": "op:monographId", "@type": "xsd:string" },
17
+ "belongsToEdition": { "@id": "op:belongsToEdition", "@type": "@id" },
18
+ "sameSubstanceAs": { "@id": "op:sameSubstanceAs", "@type": "@id", "@container": "@set" }
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@base": "https://www.openphar.org/data/thp/",
5
+ "@vocab": "https://www.openphar.org/ontology/publisher/thp/",
6
+ "thp": "https://www.openphar.org/ontology/publisher/thp/",
7
+ "op": "https://www.openphar.org/ontology/core/",
8
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
9
+ "dct": "http://purl.org/dc/terms/",
10
+ "skos": "http://www.w3.org/2004/02/skos/core#",
11
+ "id": "@id",
12
+ "type": "@type",
13
+ "title": "dct:title",
14
+ "prefLabel": "skos:prefLabel",
15
+ "publisher": "dct:publisher",
16
+ "monographId": { "@id": "op:monographId", "@type": "xsd:string" },
17
+ "belongsToEdition": { "@id": "op:belongsToEdition", "@type": "@id" },
18
+ "sameSubstanceAs": { "@id": "op:sameSubstanceAs", "@type": "@id", "@container": "@set" }
19
+ }
20
+ }
@@ -0,0 +1,30 @@
1
+ # Open Pharmacopoeia - American Herbal Pharmacopoeia (AHP) Extensions
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
5
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6
+ @prefix op: <https://www.openphar.org/ontology/core/> .
7
+ @prefix ahp: <https://www.openphar.org/ontology/publisher/ahp/> .
8
+
9
+ <https://www.openphar.org/ontology/publisher/ahp/>
10
+ a owl:Ontology ;
11
+ rdfs:label "American Herbal Pharmacopoeia Extensions"@en ;
12
+ owl:imports <https://www.openphar.org/ontology/core/> .
13
+
14
+ <https://www.openphar.org/data/publisher/ahp>
15
+ a op:Publisher ;
16
+ op:publisherCode "AHP" ;
17
+ rdfs:label "American Herbal Pharmacopoeia"@en ;
18
+ rdfs:seeAlso <https://www.herbal-ahp.org/> .
19
+
20
+ ahp:Monograph a owl:Class ; rdfs:subClassOf op:Monograph .
21
+ ahp:HerbalMonograph a owl:Class ; rdfs:subClassOf ahp:Monograph, op:CrudeDrugMonograph .
22
+ ahp:Formulation a owl:Class ; rdfs:subClassOf ahp:Monograph, op:FormulationMonograph .
23
+
24
+ ahp:commonName a owl:DatatypeProperty ; rdfs:domain ahp:Monograph ; rdfs:range xsd:string .
25
+ ahp:latinName a owl:DatatypeProperty ; rdfs:domain ahp:Monograph ; rdfs:range xsd:string .
26
+ ahp:partsUsed a owl:DatatypeProperty ; rdfs:domain ahp:HerbalMonograph ; rdfs:range xsd:string .
27
+ ahp:therapeuticAction a owl:DatatypeProperty ; rdfs:domain ahp:HerbalMonograph ; rdfs:range xsd:string .
28
+ ahp:safetyRating a owl:DatatypeProperty ; rdfs:domain ahp:HerbalMonograph ; rdfs:range xsd:string .
29
+ ahp:contraindication a owl:DatatypeProperty ; rdfs:domain ahp:HerbalMonograph ; rdfs:range xsd:string .
30
+ ahp:drugInteraction a owl:DatatypeProperty ; rdfs:domain ahp:HerbalMonograph ; rdfs:range xsd:string .
@@ -0,0 +1,38 @@
1
+ # Open Pharmacopoeia - Ayurvedic Pharmacopoeia of India (API) Extensions
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
5
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6
+ @prefix op: <https://www.openphar.org/ontology/core/> .
7
+ @prefix api: <https://www.openphar.org/ontology/publisher/api/> .
8
+
9
+ <https://www.openphar.org/ontology/publisher/api/>
10
+ a owl:Ontology ;
11
+ rdfs:label "Ayurvedic Pharmacopoeia of India Extensions"@en ;
12
+ owl:imports <https://www.openphar.org/ontology/core/> .
13
+
14
+ <https://www.openphar.org/data/publisher/api>
15
+ a op:Publisher ;
16
+ op:publisherCode "API" ;
17
+ rdfs:label "Ayurvedic Pharmacopoeia of India"@en ;
18
+ rdfs:seeAlso <https://main.ayush.gov.in/> .
19
+
20
+ api:Monograph a owl:Class ; rdfs:subClassOf op:Monograph .
21
+ api:Dravya a owl:Class ; rdfs:subClassOf api:Monograph, op:CrudeDrugMonograph .
22
+ api:Formulation a owl:Class ; rdfs:subClassOf api:Monograph, op:FormulationMonograph .
23
+ api:Bhasma a owl:Class ; rdfs:subClassOf api:Monograph, op:MineralSubstanceMonograph .
24
+
25
+ # Ayurvedic Panchakarma properties
26
+ api:rasa a owl:DatatypeProperty ; rdfs:domain api:Monograph ; rdfs:range xsd:string .
27
+ api:guna a owl:DatatypeProperty ; rdfs:domain api:Monograph ; rdfs:range xsd:string .
28
+ api:virya a owl:DatatypeProperty ; rdfs:domain api:Monograph ; rdfs:range xsd:string .
29
+ api:vipaka a owl:DatatypeProperty ; rdfs:domain api:Monograph ; rdfs:range xsd:string .
30
+ api:karma a owl:DatatypeProperty ; rdfs:domain api:Monograph ; rdfs:range xsd:string .
31
+
32
+ api:sanskritName a owl:DatatypeProperty ; rdfs:domain api:Monograph ; rdfs:range xsd:string .
33
+ api:plantPart a owl:DatatypeProperty ; rdfs:domain api:Dravya ; rdfs:range xsd:string .
34
+ api:constituent a owl:DatatypeProperty ; rdfs:domain api:Dravya ; rdfs:range xsd:string .
35
+ api:dose a owl:DatatypeProperty ; rdfs:domain api:Monograph ; rdfs:range xsd:string .
36
+
37
+ api:sourceMineral a owl:DatatypeProperty ; rdfs:domain api:Bhasma ; rdfs:range xsd:string .
38
+ api:preparationMethod a owl:DatatypeProperty ; rdfs:domain api:Formulation ; rdfs:range xsd:string .
@@ -0,0 +1,31 @@
1
+ # Open Pharmacopoeia - Hong Kong Chinese Materia Medica Standards (HKCMMS) Extensions
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
5
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6
+ @prefix op: <https://www.openphar.org/ontology/core/> .
7
+ @prefix hkcmms: <https://www.openphar.org/ontology/publisher/hkcmms/> .
8
+
9
+ <https://www.openphar.org/ontology/publisher/hkcmms/>
10
+ a owl:Ontology ;
11
+ rdfs:label "Hong Kong Chinese Materia Medica Standards Extensions"@en ;
12
+ owl:imports <https://www.openphar.org/ontology/core/> .
13
+
14
+ <https://www.openphar.org/data/publisher/hkcmms>
15
+ a op:Publisher ;
16
+ op:publisherCode "HKCMMS" ;
17
+ rdfs:label "Hong Kong Chinese Materia Medica Standards"@en ;
18
+ rdfs:seeAlso <https://www.cmchk.org.hk/> .
19
+
20
+ hkcmms:Monograph a owl:Class ; rdfs:subClassOf op:Monograph .
21
+ hkcmms:TcmCrudeDrug a owl:Class ; rdfs:subClassOf hkcmms:Monograph, op:CrudeDrugMonograph .
22
+ hkcmms:TcmFormulation a owl:Class ; rdfs:subClassOf hkcmms:Monograph, op:FormulationMonograph .
23
+
24
+ # TCM pharmacological properties (四气五味归经)
25
+ hkcmms:chineseName a owl:DatatypeProperty ; rdfs:domain hkcmms:Monograph ; rdfs:range xsd:string .
26
+ hkcmms:pinyinName a owl:DatatypeProperty ; rdfs:domain hkcmms:Monograph ; rdfs:range xsd:string .
27
+ hkcmms:nature a owl:DatatypeProperty ; rdfs:domain hkcmms:TcmCrudeDrug ; rdfs:range xsd:string .
28
+ hkcmms:flavor a owl:DatatypeProperty ; rdfs:domain hkcmms:TcmCrudeDrug ; rdfs:range xsd:string .
29
+ hkcmms:meridianTropism a owl:DatatypeProperty ; rdfs:domain hkcmms:TcmCrudeDrug ; rdfs:range xsd:string .
30
+ hkcmms:function a owl:DatatypeProperty ; rdfs:domain hkcmms:TcmCrudeDrug ; rdfs:range xsd:string .
31
+ hkcmms:indication a owl:DatatypeProperty ; rdfs:domain hkcmms:TcmCrudeDrug ; rdfs:range xsd:string .
@@ -0,0 +1,40 @@
1
+ # Open Pharmacopoeia - Japanese Pharmacopoeia (JP) Extensions
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
5
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6
+ @prefix op: <https://www.openphar.org/ontology/core/> .
7
+ @prefix jp: <https://www.openphar.org/ontology/publisher/jp/> .
8
+
9
+ <https://www.openphar.org/ontology/publisher/jp/>
10
+ a owl:Ontology ;
11
+ rdfs:label "Japanese Pharmacopoeia Extensions"@en ;
12
+ owl:imports <https://www.openphar.org/ontology/core/> .
13
+
14
+ <https://www.openphar.org/data/publisher/jp>
15
+ a op:Publisher ;
16
+ op:publisherCode "JP" ;
17
+ rdfs:label "Japanese Pharmacopoeia"@en ;
18
+ rdfs:seeAlso <https://www.mhlw.go.jp/topics/bukyoku/iyaku/yakkyoku/> .
19
+
20
+ jp:Monograph a owl:Class ; rdfs:subClassOf op:Monograph .
21
+ jp:CrudeDrug a owl:Class ; rdfs:subClassOf jp:Monograph, op:CrudeDrugMonograph .
22
+ jp:PowderedCrudeDrug a owl:Class ; rdfs:subClassOf jp:CrudeDrug .
23
+ jp:ChemicalDrug a owl:Class ; rdfs:subClassOf jp:Monograph, op:ChemicalDrugMonograph .
24
+ jp:Formulation a owl:Class ; rdfs:subClassOf jp:Monograph, op:FormulationMonograph .
25
+ jp:Biological a owl:Class ; rdfs:subClassOf jp:Monograph, op:BiologicalSubstanceMonograph .
26
+ jp:Excipient a owl:Class ; rdfs:subClassOf jp:Monograph .
27
+ jp:Vitamin a owl:Class ; rdfs:subClassOf jp:Monograph, op:VitaminMonograph .
28
+ jp:AminoAcid a owl:Class ; rdfs:subClassOf jp:Monograph, op:AminoAcidMonograph .
29
+ jp:Mineral a owl:Class ; rdfs:subClassOf jp:Monograph, op:MineralSubstanceMonograph .
30
+
31
+ jp:japaneseName a owl:DatatypeProperty ; rdfs:domain jp:Monograph ; rdfs:range xsd:string .
32
+ jp:englishName a owl:DatatypeProperty ; rdfs:domain jp:Monograph ; rdfs:range xsd:string .
33
+ jp:category a owl:DatatypeProperty ; rdfs:domain jp:Monograph ; rdfs:range xsd:string .
34
+ jp:botanicalSource a owl:ObjectProperty ; rdfs:domain jp:CrudeDrug .
35
+
36
+ <https://www.openphar.org/data/edition/jp18>
37
+ a op:Edition ;
38
+ op:publisherCode "JP" ;
39
+ op:editionNumber "18" ;
40
+ rdfs:label "Japanese Pharmacopoeia 18th edition"@en .
@@ -0,0 +1,28 @@
1
+ # Open Pharmacopoeia - Thai Herbal Pharmacopoeia (THP) Extensions
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
5
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6
+ @prefix op: <https://www.openphar.org/ontology/core/> .
7
+ @prefix thp: <https://www.openphar.org/ontology/publisher/thp/> .
8
+
9
+ <https://www.openphar.org/ontology/publisher/thp/>
10
+ a owl:Ontology ;
11
+ rdfs:label "Thai Herbal Pharmacopoeia Extensions"@en ;
12
+ owl:imports <https://www.openphar.org/ontology/core/> .
13
+
14
+ <https://www.openphar.org/data/publisher/thp>
15
+ a op:Publisher ;
16
+ op:publisherCode "THP" ;
17
+ rdfs:label "Thai Herbal Pharmacopoeia"@en ;
18
+ rdfs:seeAlso <http://www.fda.moph.go.th/> .
19
+
20
+ thp:Monograph a owl:Class ; rdfs:subClassOf op:Monograph .
21
+ thp:HerbalMonograph a owl:Class ; rdfs:subClassOf thp:Monograph, op:CrudeDrugMonograph .
22
+ thp:CannabisMonograph a owl:Class ; rdfs:subClassOf thp:Monograph, op:CrudeDrugMonograph .
23
+
24
+ thp:thaiName a owl:DatatypeProperty ; rdfs:domain thp:Monograph ; rdfs:range xsd:string .
25
+ thp:plantPart a owl:DatatypeProperty ; rdfs:domain thp:HerbalMonograph ; rdfs:range xsd:string .
26
+ thp:thcContent a owl:DatatypeProperty ; rdfs:domain thp:CannabisMonograph ; rdfs:range xsd:string .
27
+ thp:cbdContent a owl:DatatypeProperty ; rdfs:domain thp:CannabisMonograph ; rdfs:range xsd:string .
28
+ thp:cultivar a owl:DatatypeProperty ; rdfs:domain thp:CannabisMonograph ; rdfs:range xsd:string .
@@ -0,0 +1,28 @@
1
+ # SHACL shapes for AHP monographs.
2
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix op: <https://www.openphar.org/ontology/core/> .
5
+ @prefix dct: <http://purl.org/dc/terms/> .
6
+ @prefix ahp: <https://www.openphar.org/ontology/publisher/ahp/> .
7
+
8
+ ahp:MonographShape
9
+ a sh:NodeShape ;
10
+ sh:targetClass ahp:Monograph ;
11
+ sh:property [
12
+ sh:path op:monographId ;
13
+ sh:datatype xsd:string ;
14
+ sh:minCount 1 ;
15
+ sh:severity sh:Violation ;
16
+ sh:message "AHP monograph must have a monographId."@en ;
17
+ ] ;
18
+ sh:property [
19
+ sh:path dct:title ;
20
+ sh:datatype xsd:string ;
21
+ sh:minCount 1 ;
22
+ sh:severity sh:Violation ;
23
+ ] ;
24
+ sh:property [
25
+ sh:path op:publisher ;
26
+ sh:hasValue "AHP" ;
27
+ sh:severity sh:Violation ;
28
+ ] .
@@ -0,0 +1,28 @@
1
+ # SHACL shapes for API monographs.
2
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix op: <https://www.openphar.org/ontology/core/> .
5
+ @prefix dct: <http://purl.org/dc/terms/> .
6
+ @prefix api: <https://www.openphar.org/ontology/publisher/api/> .
7
+
8
+ api:MonographShape
9
+ a sh:NodeShape ;
10
+ sh:targetClass api:Monograph ;
11
+ sh:property [
12
+ sh:path op:monographId ;
13
+ sh:datatype xsd:string ;
14
+ sh:minCount 1 ;
15
+ sh:severity sh:Violation ;
16
+ sh:message "API monograph must have a monographId."@en ;
17
+ ] ;
18
+ sh:property [
19
+ sh:path dct:title ;
20
+ sh:datatype xsd:string ;
21
+ sh:minCount 1 ;
22
+ sh:severity sh:Violation ;
23
+ ] ;
24
+ sh:property [
25
+ sh:path op:publisher ;
26
+ sh:hasValue "API" ;
27
+ sh:severity sh:Violation ;
28
+ ] .
@@ -0,0 +1,28 @@
1
+ # SHACL shapes for HKCMMS monographs.
2
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix op: <https://www.openphar.org/ontology/core/> .
5
+ @prefix dct: <http://purl.org/dc/terms/> .
6
+ @prefix hkcmms: <https://www.openphar.org/ontology/publisher/hkcmms/> .
7
+
8
+ hkcmms:MonographShape
9
+ a sh:NodeShape ;
10
+ sh:targetClass hkcmms:Monograph ;
11
+ sh:property [
12
+ sh:path op:monographId ;
13
+ sh:datatype xsd:string ;
14
+ sh:minCount 1 ;
15
+ sh:severity sh:Violation ;
16
+ sh:message "HKCMMS monograph must have a monographId."@en ;
17
+ ] ;
18
+ sh:property [
19
+ sh:path dct:title ;
20
+ sh:datatype xsd:string ;
21
+ sh:minCount 1 ;
22
+ sh:severity sh:Violation ;
23
+ ] ;
24
+ sh:property [
25
+ sh:path op:publisher ;
26
+ sh:hasValue "HKCMMS" ;
27
+ sh:severity sh:Violation ;
28
+ ] .
@@ -0,0 +1,28 @@
1
+ # SHACL shapes for JP monographs.
2
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix op: <https://www.openphar.org/ontology/core/> .
5
+ @prefix dct: <http://purl.org/dc/terms/> .
6
+ @prefix jp: <https://www.openphar.org/ontology/publisher/jp/> .
7
+
8
+ jp:MonographShape
9
+ a sh:NodeShape ;
10
+ sh:targetClass jp:Monograph ;
11
+ sh:property [
12
+ sh:path op:monographId ;
13
+ sh:datatype xsd:string ;
14
+ sh:minCount 1 ;
15
+ sh:severity sh:Violation ;
16
+ sh:message "JP monograph must have a monographId."@en ;
17
+ ] ;
18
+ sh:property [
19
+ sh:path dct:title ;
20
+ sh:datatype xsd:string ;
21
+ sh:minCount 1 ;
22
+ sh:severity sh:Violation ;
23
+ ] ;
24
+ sh:property [
25
+ sh:path op:publisher ;
26
+ sh:hasValue "JP" ;
27
+ sh:severity sh:Violation ;
28
+ ] .
@@ -0,0 +1,15 @@
1
+ # SHACL shapes for Ph.Int. monographs.
2
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix op: <https://www.openphar.org/ontology/core/> .
5
+ @prefix phint: <https://www.openphar.org/ontology/publisher/phint/> .
6
+
7
+ phint:MonographShape
8
+ a sh:NodeShape ;
9
+ sh:targetClass phint:PharmaceuticalSubstance ;
10
+ sh:property [
11
+ sh:path op:monographId ;
12
+ sh:datatype xsd:string ;
13
+ sh:minCount 1 ;
14
+ sh:severity sh:Violation ;
15
+ ] .
@@ -0,0 +1,28 @@
1
+ # SHACL shapes for THP monographs.
2
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix op: <https://www.openphar.org/ontology/core/> .
5
+ @prefix dct: <http://purl.org/dc/terms/> .
6
+ @prefix thp: <https://www.openphar.org/ontology/publisher/thp/> .
7
+
8
+ thp:MonographShape
9
+ a sh:NodeShape ;
10
+ sh:targetClass thp:Monograph ;
11
+ sh:property [
12
+ sh:path op:monographId ;
13
+ sh:datatype xsd:string ;
14
+ sh:minCount 1 ;
15
+ sh:severity sh:Violation ;
16
+ sh:message "THP monograph must have a monographId."@en ;
17
+ ] ;
18
+ sh:property [
19
+ sh:path dct:title ;
20
+ sh:datatype xsd:string ;
21
+ sh:minCount 1 ;
22
+ sh:severity sh:Violation ;
23
+ ] ;
24
+ sh:property [
25
+ sh:path op:publisher ;
26
+ sh:hasValue "THP" ;
27
+ sh:severity sh:Violation ;
28
+ ] .
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openphar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SIPM
@@ -226,9 +226,14 @@ files:
226
226
  - lib/openphar/migrators/phint_migrator.rb
227
227
  - lib/openphar/models.rb
228
228
  - lib/openphar/models/ahp.rb
229
+ - lib/openphar/models/ahp/formulation.rb
230
+ - lib/openphar/models/ahp/herbal_monograph.rb
229
231
  - lib/openphar/models/ahp/monograph.rb
230
232
  - lib/openphar/models/amino_acid_monograph.rb
231
233
  - lib/openphar/models/api.rb
234
+ - lib/openphar/models/api/bhasma.rb
235
+ - lib/openphar/models/api/dravya.rb
236
+ - lib/openphar/models/api/formulation.rb
232
237
  - lib/openphar/models/api/monograph.rb
233
238
  - lib/openphar/models/assay_specification.rb
234
239
  - lib/openphar/models/base_entity.rb
@@ -249,6 +254,8 @@ files:
249
254
  - lib/openphar/models/formulation_monograph.rb
250
255
  - lib/openphar/models/hkcmms.rb
251
256
  - lib/openphar/models/hkcmms/monograph.rb
257
+ - lib/openphar/models/hkcmms/tcm_crude_drug.rb
258
+ - lib/openphar/models/hkcmms/tcm_formulation.rb
252
259
  - lib/openphar/models/identification_specification.rb
253
260
  - lib/openphar/models/jp.rb
254
261
  - lib/openphar/models/jp/amino_acid.rb
@@ -260,6 +267,7 @@ files:
260
267
  - lib/openphar/models/jp/kampo_formula.rb
261
268
  - lib/openphar/models/jp/mineral.rb
262
269
  - lib/openphar/models/jp/monograph.rb
270
+ - lib/openphar/models/jp/powdered_crude_drug.rb
263
271
  - lib/openphar/models/jp/vitamin.rb
264
272
  - lib/openphar/models/limit.rb
265
273
  - lib/openphar/models/mineral_substance_monograph.rb
@@ -279,6 +287,8 @@ files:
279
287
  - lib/openphar/models/supplement.rb
280
288
  - lib/openphar/models/test_specification.rb
281
289
  - lib/openphar/models/thp.rb
290
+ - lib/openphar/models/thp/cannabis_monograph.rb
291
+ - lib/openphar/models/thp/herbal_monograph.rb
282
292
  - lib/openphar/models/thp/monograph.rb
283
293
  - lib/openphar/models/vitamin_monograph.rb
284
294
  - lib/openphar/monograph_merger.rb
@@ -298,19 +308,35 @@ files:
298
308
  - lib/openphar/transformers/jsonld_transformer.rb
299
309
  - lib/openphar/version.rb
300
310
  - ontology/bibliographic/edition.ttl
311
+ - ontology/context/ahp.jsonld
312
+ - ontology/context/api.jsonld
301
313
  - ontology/context/chp.jsonld
302
314
  - ontology/context/crude-drugs.jsonld
315
+ - ontology/context/hkcmms.jsonld
316
+ - ontology/context/jp.jsonld
303
317
  - ontology/context/pharmacopoeia.jsonld
318
+ - ontology/context/thp.jsonld
304
319
  - ontology/core/identification.ttl
305
320
  - ontology/core/pharmacopoeia.ttl
306
321
  - ontology/core/substance-form.ttl
307
322
  - ontology/core/unit.ttl
323
+ - ontology/publisher/ahp/extensions.ttl
324
+ - ontology/publisher/api/extensions.ttl
308
325
  - ontology/publisher/chp/extensions.ttl
326
+ - ontology/publisher/hkcmms/extensions.ttl
327
+ - ontology/publisher/jp/extensions.ttl
309
328
  - ontology/publisher/phint/extensions.ttl
329
+ - ontology/publisher/thp/extensions.ttl
310
330
  - ontology/quality/test-method.ttl
331
+ - shapes/ahp/monograph.ttl
332
+ - shapes/api/monograph.ttl
311
333
  - shapes/chp/monograph.ttl
312
334
  - shapes/edition-shapes.ttl
335
+ - shapes/hkcmms/monograph.ttl
336
+ - shapes/jp/monograph.ttl
313
337
  - shapes/monograph-shapes.ttl
338
+ - shapes/phint/monograph.ttl
339
+ - shapes/thp/monograph.ttl
314
340
  homepage: https://github.com/openphar/open-pharmacopoeia
315
341
  licenses:
316
342
  - MIT