Passed
Push — v4 ( b636d0...2d2527 )
by Andrew
39:55 queued 27:10
created

Drug::getSchemaPropertyExpectedTypes()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 106
Code Lines 104

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 104
dl 0
loc 106
ccs 0
cts 105
cp 0
rs 8
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/**
4
 * SEOmatic plugin for Craft CMS 4
5
 *
6
 * A turnkey SEO implementation for Craft CMS that is comprehensive, powerful, and flexible
7
 *
8
 * @link      https://nystudio107.com
9
 * @copyright Copyright (c) 2023 nystudio107
10
 */
11
12
namespace nystudio107\seomatic\models\jsonld;
13
14
use nystudio107\seomatic\models\MetaJsonLd;
15
16
/**
17
 * schema.org version: v15.0-release
18
 * Drug - A chemical or biologic substance, used as a medical therapy, that has a
19
 * physiological effect on an organism. Here the term drug is used
20
 * interchangeably with the term medicine although clinical knowledge makes a
21
 * clear difference between them.
22
 *
23
 * @author    nystudio107
24
 * @package   Seomatic
25
 * @see       https://schema.org/Drug
26
 */
27
class Drug extends MetaJsonLd implements DrugInterface, ProductInterface, ThingInterface, SubstanceInterface, MedicalEntityInterface
28
{
29
	use DrugTrait;
30
	use ProductTrait;
31
	use ThingTrait;
32
	use SubstanceTrait;
33
	use MedicalEntityTrait;
34
35
	/**
36
	 * The Schema.org Type Name
37
	 *
38
	 * @var string
39
	 */
40
	public static string $schemaTypeName = 'Drug';
41
42
	/**
43
	 * The Schema.org Type Scope
44
	 *
45
	 * @var string
46
	 */
47
	public static string $schemaTypeScope = 'https://schema.org/Drug';
48
49
	/**
50
	 * The Schema.org Type Extends
51
	 *
52
	 * @var string
53
	 */
54
	public static string $schemaTypeExtends = 'Product';
55
56
	/**
57
	 * The Schema.org Type Description
58
	 *
59
	 * @var string
60
	 */
61
	public static string $schemaTypeDescription = 'A chemical or biologic substance, used as a medical therapy, that has a physiological effect on an organism. Here the term drug is used interchangeably with the term medicine although clinical knowledge makes a clear difference between them.';
62
63
64
	/**
65
	 * @inheritdoc
66
	 */
67
	public function getSchemaPropertyNames(): array
68
	{
69
		return array_keys($this->getSchemaPropertyExpectedTypes());
70
	}
71
72
73
	/**
74
	 * @inheritdoc
75
	 */
76
	public function getSchemaPropertyExpectedTypes(): array
77
	{
78
		return [
79
		    'activeIngredient' => ['Text'],
80
		    'additionalProperty' => ['PropertyValue'],
81
		    'additionalType' => ['URL'],
82
		    'administrationRoute' => ['Text'],
83
		    'aggregateRating' => ['AggregateRating'],
84
		    'alcoholWarning' => ['Text'],
85
		    'alternateName' => ['Text'],
86
		    'asin' => ['Text', 'URL'],
87
		    'audience' => ['Audience'],
88
		    'availableStrength' => ['DrugStrength'],
89
		    'award' => ['Text'],
90
		    'awards' => ['Text'],
91
		    'brand' => ['Brand', 'Organization'],
92
		    'breastfeedingWarning' => ['Text'],
93
		    'category' => ['URL', 'CategoryCode', 'Text', 'Thing', 'PhysicalActivityCategory'],
94
		    'clincalPharmacology' => ['Text'],
95
		    'clinicalPharmacology' => ['Text'],
96
		    'code' => ['MedicalCode'],
97
		    'color' => ['Text'],
98
		    'countryOfAssembly' => ['Text'],
99
		    'countryOfLastProcessing' => ['Text'],
100
		    'countryOfOrigin' => ['Country'],
101
		    'depth' => ['QuantitativeValue', 'Distance'],
102
		    'description' => ['Text'],
103
		    'disambiguatingDescription' => ['Text'],
104
		    'dosageForm' => ['Text'],
105
		    'doseSchedule' => ['DoseSchedule'],
106
		    'drugClass' => ['DrugClass'],
107
		    'drugUnit' => ['Text'],
108
		    'foodWarning' => ['Text'],
109
		    'funding' => ['Grant'],
110
		    'gtin' => ['Text', 'URL'],
111
		    'gtin12' => ['Text'],
112
		    'gtin13' => ['Text'],
113
		    'gtin14' => ['Text'],
114
		    'gtin8' => ['Text'],
115
		    'guideline' => ['MedicalGuideline'],
116
		    'hasAdultConsideration' => ['AdultOrientedEnumeration'],
117
		    'hasEnergyConsumptionDetails' => ['EnergyConsumptionDetails'],
118
		    'hasMeasurement' => ['QuantitativeValue'],
119
		    'hasMerchantReturnPolicy' => ['MerchantReturnPolicy'],
120
		    'height' => ['QuantitativeValue', 'Distance'],
121
		    'identifier' => ['PropertyValue', 'URL', 'Text'],
122
		    'image' => ['URL', 'ImageObject'],
123
		    'inProductGroupWithID' => ['Text'],
124
		    'includedInHealthInsurancePlan' => ['HealthInsurancePlan'],
125
		    'interactingDrug' => ['Drug'],
126
		    'isAccessoryOrSparePartFor' => ['Product'],
127
		    'isAvailableGenerically' => ['Boolean'],
128
		    'isConsumableFor' => ['Product'],
129
		    'isFamilyFriendly' => ['Boolean'],
130
		    'isProprietary' => ['Boolean'],
131
		    'isRelatedTo' => ['Product', 'Service'],
132
		    'isSimilarTo' => ['Product', 'Service'],
133
		    'isVariantOf' => ['ProductModel', 'ProductGroup'],
134
		    'itemCondition' => ['OfferItemCondition'],
135
		    'keywords' => ['URL', 'DefinedTerm', 'Text'],
136
		    'labelDetails' => ['URL'],
137
		    'legalStatus' => ['Text', 'DrugLegalStatus', 'MedicalEnumeration'],
138
		    'logo' => ['ImageObject', 'URL'],
139
		    'mainEntityOfPage' => ['URL', 'CreativeWork'],
140
		    'manufacturer' => ['Organization'],
141
		    'material' => ['Product', 'URL', 'Text'],
142
		    'maximumIntake' => ['MaximumDoseSchedule'],
143
		    'mechanismOfAction' => ['Text'],
144
		    'medicineSystem' => ['MedicineSystem'],
145
		    'mobileUrl' => ['Text'],
146
		    'model' => ['ProductModel', 'Text'],
147
		    'mpn' => ['Text'],
148
		    'name' => ['Text'],
149
		    'negativeNotes' => ['ListItem', 'Text', 'ItemList', 'WebContent'],
150
		    'nonProprietaryName' => ['Text'],
151
		    'nsn' => ['Text'],
152
		    'offers' => ['Demand', 'Offer'],
153
		    'overdosage' => ['Text'],
154
		    'pattern' => ['DefinedTerm', 'Text'],
155
		    'positiveNotes' => ['Text', 'WebContent', 'ListItem', 'ItemList'],
156
		    'potentialAction' => ['Action'],
157
		    'pregnancyCategory' => ['DrugPregnancyCategory'],
158
		    'pregnancyWarning' => ['Text'],
159
		    'prescribingInfo' => ['URL'],
160
		    'prescriptionStatus' => ['Text', 'DrugPrescriptionStatus'],
161
		    'productID' => ['Text'],
162
		    'productionDate' => ['Date'],
163
		    'proprietaryName' => ['Text'],
164
		    'purchaseDate' => ['Date'],
165
		    'recognizingAuthority' => ['Organization'],
166
		    'relatedDrug' => ['Drug'],
167
		    'releaseDate' => ['Date'],
168
		    'relevantSpecialty' => ['MedicalSpecialty'],
169
		    'review' => ['Review'],
170
		    'reviews' => ['Review'],
171
		    'rxcui' => ['Text'],
172
		    'sameAs' => ['URL'],
173
		    'size' => ['DefinedTerm', 'QuantitativeValue', 'Text', 'SizeSpecification'],
174
		    'sku' => ['Text'],
175
		    'slogan' => ['Text'],
176
		    'study' => ['MedicalStudy'],
177
		    'subjectOf' => ['Event', 'CreativeWork'],
178
		    'url' => ['URL'],
179
		    'warning' => ['Text', 'URL'],
180
		    'weight' => ['QuantitativeValue'],
181
		    'width' => ['Distance', 'QuantitativeValue']
182
		];
183
	}
184
185
186
	/**
187
	 * @inheritdoc
188
	 */
189
	public function getSchemaPropertyDescriptions(): array
190
	{
191
		return [
192
		    'activeIngredient' => 'An active ingredient, typically chemical compounds and/or biologic substances.',
193
		    'additionalProperty' => 'A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.  Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. ',
194
		    'additionalType' => 'An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the \'typeof\' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.',
195
		    'administrationRoute' => 'A route by which this drug may be administered, e.g. \'oral\'.',
196
		    'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.',
197
		    'alcoholWarning' => 'Any precaution, guidance, contraindication, etc. related to consumption of alcohol while taking this drug.',
198
		    'alternateName' => 'An alias for the item.',
199
		    'asin' => 'An Amazon Standard Identification Number (ASIN) is a 10-character alphanumeric unique identifier assigned by Amazon.com and its partners for product identification within the Amazon organization (summary from [Wikipedia](https://en.wikipedia.org/wiki/Amazon_Standard_Identification_Number)\'s article).  Note also that this is a definition for how to include ASINs in Schema.org data, and not a definition of ASINs in general - see documentation from Amazon for authoritative details. ASINs are most commonly encoded as text strings, but the [asin] property supports URL/URI as potential values too.',
200
		    'audience' => 'An intended audience, i.e. a group for whom something was created.',
201
		    'availableStrength' => 'An available dosage strength for the drug.',
202
		    'award' => 'An award won by or for this item.',
203
		    'awards' => 'Awards won by or for this item.',
204
		    'brand' => 'The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.',
205
		    'breastfeedingWarning' => 'Any precaution, guidance, contraindication, etc. related to this drug\'s use by breastfeeding mothers.',
206
		    'category' => 'A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.',
207
		    'clincalPharmacology' => 'Description of the absorption and elimination of drugs, including their concentration (pharmacokinetics, pK) and biological effects (pharmacodynamics, pD).',
208
		    'clinicalPharmacology' => 'Description of the absorption and elimination of drugs, including their concentration (pharmacokinetics, pK) and biological effects (pharmacodynamics, pD).',
209
		    'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.',
210
		    'color' => 'The color of the product.',
211
		    'countryOfAssembly' => 'The place where the product was assembled.',
212
		    'countryOfLastProcessing' => 'The place where the item (typically [[Product]]) was last processed and tested before importation.',
213
		    'countryOfOrigin' => 'The country of origin of something, including products as well as creative  works such as movie and TV content.  In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable.  In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.',
214
		    'depth' => 'The depth of the item.',
215
		    'description' => 'A description of the item.',
216
		    'disambiguatingDescription' => 'A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.',
217
		    'dosageForm' => 'A dosage form in which this drug/supplement is available, e.g. \'tablet\', \'suspension\', \'injection\'.',
218
		    'doseSchedule' => 'A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used.',
219
		    'drugClass' => 'The class of drug this belongs to (e.g., statins).',
220
		    'drugUnit' => 'The unit in which the drug is measured, e.g. \'5 mg tablet\'.',
221
		    'foodWarning' => 'Any precaution, guidance, contraindication, etc. related to consumption of specific foods while taking this drug.',
222
		    'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].',
223
		    'gtin' => 'A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes.  The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs (URIs, IRIs, etc.). Details including regular expression examples can be found in, Section 6 of the GS1 URI Syntax specification; see also [schema.org tracking issue](https://github.com/schemaorg/schemaorg/issues/3156#issuecomment-1209522809) for schema.org-specific discussion. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1\'s GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties.  Note also that this is a definition for how to include GTINs in Schema.org data, and not a definition of GTINs in general - see the GS1 documentation for authoritative details.',
224
		    'gtin12' => 'The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.',
225
		    'gtin13' => 'The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.',
226
		    'gtin14' => 'The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.',
227
		    'gtin8' => 'The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.',
228
		    'guideline' => 'A medical guideline related to this entity.',
229
		    'hasAdultConsideration' => 'Used to tag an item to be intended or suitable for consumption or use by adults only.',
230
		    'hasEnergyConsumptionDetails' => 'Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard.',
231
		    'hasMeasurement' => 'A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings.',
232
		    'hasMerchantReturnPolicy' => 'Specifies a MerchantReturnPolicy that may be applicable.',
233
		    'height' => 'The height of the item.',
234
		    'identifier' => 'The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.         ',
235
		    'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].',
236
		    'inProductGroupWithID' => 'Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. ',
237
		    'includedInHealthInsurancePlan' => 'The insurance plans that cover this drug.',
238
		    'interactingDrug' => 'Another drug that is known to interact with this drug in a way that impacts the effect of this drug or causes a risk to the patient. Note: disease interactions are typically captured as contraindications.',
239
		    'isAccessoryOrSparePartFor' => 'A pointer to another product (or multiple products) for which this product is an accessory or spare part.',
240
		    'isAvailableGenerically' => 'True if the drug is available in a generic form (regardless of name).',
241
		    'isConsumableFor' => 'A pointer to another product (or multiple products) for which this product is a consumable.',
242
		    'isFamilyFriendly' => 'Indicates whether this content is family friendly.',
243
		    'isProprietary' => 'True if this item\'s name is a proprietary/brand name (vs. generic name).',
244
		    'isRelatedTo' => 'A pointer to another, somehow related product (or multiple products).',
245
		    'isSimilarTo' => 'A pointer to another, functionally similar product (or multiple products).',
246
		    'isVariantOf' => 'Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group.',
247
		    'itemCondition' => 'A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns.',
248
		    'keywords' => 'Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.',
249
		    'labelDetails' => 'Link to the drug\'s label details.',
250
		    'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.',
251
		    'logo' => 'An associated logo.',
252
		    'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.',
253
		    'manufacturer' => 'The manufacturer of the product.',
254
		    'material' => 'A material that something is made from, e.g. leather, wool, cotton, paper.',
255
		    'maximumIntake' => 'Recommended intake of this supplement for a given population as defined by a specific recommending authority.',
256
		    'mechanismOfAction' => 'The specific biochemical interaction through which this drug or supplement produces its pharmacological effect.',
257
		    'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.',
258
		    'mobileUrl' => 'The [[mobileUrl]] property is provided for specific situations in which data consumers need to determine whether one of several provided URLs is a dedicated \'mobile site\'.  To discourage over-use, and reflecting intial usecases, the property is expected only on [[Product]] and [[Offer]], rather than [[Thing]]. The general trend in web technology is towards [responsive design](https://en.wikipedia.org/wiki/Responsive_web_design) in which content can be flexibly adapted to a wide range of browsing environments. Pages and sites referenced with the long-established [[url]] property should ideally also be usable on a wide variety of devices, including mobile phones. In most cases, it would be pointless and counter productive to attempt to update all [[url]] markup to use [[mobileUrl]] for more mobile-oriented pages. The property is intended for the case when items (primarily [[Product]] and [[Offer]]) have extra URLs hosted on an additional "mobile site" alongside the main one. It should not be taken as an endorsement of this publication style.     ',
259
		    'model' => 'The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties.',
260
		    'mpn' => 'The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers.',
261
		    'name' => 'The name of the item.',
262
		    'negativeNotes' => 'Provides negative considerations regarding something, most typically in pro/con lists for reviews (alongside [[positiveNotes]]). For symmetry   In the case of a [[Review]], the property describes the [[itemReviewed]] from the perspective of the review; in the case of a [[Product]], the product itself is being described. Since product descriptions  tend to emphasise positive claims, it may be relatively unusual to find [[negativeNotes]] used in this way. Nevertheless for the sake of symmetry, [[negativeNotes]] can be used on [[Product]].  The property values can be expressed either as unstructured text (repeated as necessary), or if ordered, as a list (in which case the most negative is at the beginning of the list).',
263
		    'nonProprietaryName' => 'The generic name of this drug or supplement.',
264
		    'nsn' => 'Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. ',
265
		    'offers' => 'An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.       ',
266
		    'overdosage' => 'Any information related to overdose on a drug, including signs or symptoms, treatments, contact information for emergency response.',
267
		    'pattern' => 'A pattern that something has, for example \'polka dot\', \'striped\', \'Canadian flag\'. Values are typically expressed as text, although links to controlled value schemes are also supported.',
268
		    'positiveNotes' => 'Provides positive considerations regarding something, for example product highlights or (alongside [[negativeNotes]]) pro/con lists for reviews.  In the case of a [[Review]], the property describes the [[itemReviewed]] from the perspective of the review; in the case of a [[Product]], the product itself is being described.  The property values can be expressed either as unstructured text (repeated as necessary), or if ordered, as a list (in which case the most positive is at the beginning of the list).',
269
		    'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.',
270
		    'pregnancyCategory' => 'Pregnancy category of this drug.',
271
		    'pregnancyWarning' => 'Any precaution, guidance, contraindication, etc. related to this drug\'s use during pregnancy.',
272
		    'prescribingInfo' => 'Link to prescribing information for the drug.',
273
		    'prescriptionStatus' => 'Indicates the status of drug prescription, e.g. local catalogs classifications or whether the drug is available by prescription or over-the-counter, etc.',
274
		    'productID' => 'The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```.',
275
		    'productionDate' => 'The date of production of the item, e.g. vehicle.',
276
		    'proprietaryName' => 'Proprietary name given to the diet plan, typically by its originator or creator.',
277
		    'purchaseDate' => 'The date the item, e.g. vehicle, was purchased by the current owner.',
278
		    'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.',
279
		    'relatedDrug' => 'Any other drug related to this one, for example commonly-prescribed alternatives.',
280
		    'releaseDate' => 'The release date of a product or product model. This can be used to distinguish the exact variant of a product.',
281
		    'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.',
282
		    'review' => 'A review of the item.',
283
		    'reviews' => 'Review of the item.',
284
		    'rxcui' => 'The RxCUI drug identifier from RXNORM.',
285
		    'sameAs' => 'URL of a reference Web page that unambiguously indicates the item\'s identity. E.g. the URL of the item\'s Wikipedia page, Wikidata entry, or official website.',
286
		    'size' => 'A standardized size of a product or creative work, specified either through a simple textual string (for example \'XL\', \'32Wx34L\'), a  QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. ',
287
		    'sku' => 'The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers.',
288
		    'slogan' => 'A slogan or motto associated with the item.',
289
		    'study' => 'A medical study or trial related to this entity.',
290
		    'subjectOf' => 'A CreativeWork or Event about this Thing.',
291
		    'url' => 'URL of the item.',
292
		    'warning' => 'Any FDA or other warnings about the drug (text or URL).',
293
		    'weight' => 'The weight of the product or person.',
294
		    'width' => 'The width of the item.'
295
		];
296
	}
297
298
299
	/**
300
	 * @inheritdoc
301
	 */
302
	public function getGoogleRequiredSchema(): array
303
	{
304
		return ['description', 'name'];
305
	}
306
307
308
	/**
309
	 * @inheritdoc
310
	 */
311
	public function getGoogleRecommendedSchema(): array
312
	{
313
		return ['image', 'url'];
314
	}
315
316
317
	/**
318
	 * @inheritdoc
319
	 */
320
	public function defineRules(): array
321
	{
322
		$rules = parent::defineRules();
323
		    $rules = array_merge($rules, [
324
		        [$this->getSchemaPropertyNames(), 'validateJsonSchema'],
325
		        [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'],
326
		        [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.']
327
		    ]);
328
329
		    return $rules;
330
	}
331
}
332