@@ -27,156 +27,156 @@ |
||
27 | 27 | */ |
28 | 28 | class Gene extends MetaJsonLd implements GeneInterface, BioChemEntityInterface, ThingInterface |
29 | 29 | { |
30 | - use GeneTrait; |
|
31 | - use BioChemEntityTrait; |
|
32 | - use ThingTrait; |
|
33 | - |
|
34 | - /** |
|
35 | - * The Schema.org Type Name |
|
36 | - * |
|
37 | - * @var string |
|
38 | - */ |
|
39 | - public static string $schemaTypeName = 'Gene'; |
|
40 | - |
|
41 | - /** |
|
42 | - * The Schema.org Type Scope |
|
43 | - * |
|
44 | - * @var string |
|
45 | - */ |
|
46 | - public static string $schemaTypeScope = 'https://schema.org/Gene'; |
|
47 | - |
|
48 | - /** |
|
49 | - * The Schema.org Type Extends |
|
50 | - * |
|
51 | - * @var string |
|
52 | - */ |
|
53 | - public static string $schemaTypeExtends = 'BioChemEntity'; |
|
54 | - |
|
55 | - /** |
|
56 | - * The Schema.org Type Description |
|
57 | - * |
|
58 | - * @var string |
|
59 | - */ |
|
60 | - public static string $schemaTypeDescription = 'A discrete unit of inheritance which affects one or more biological traits (Source: [https://en.wikipedia.org/wiki/Gene](https://en.wikipedia.org/wiki/Gene)). Examples include FOXP2 (Forkhead box protein P2), SCARNA21 (small Cajal body-specific RNA 21), A- (agouti genotype).'; |
|
61 | - |
|
62 | - |
|
63 | - /** |
|
64 | - * @inheritdoc |
|
65 | - */ |
|
66 | - public function getSchemaPropertyNames(): array |
|
67 | - { |
|
68 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
69 | - } |
|
70 | - |
|
71 | - |
|
72 | - /** |
|
73 | - * @inheritdoc |
|
74 | - */ |
|
75 | - public function getSchemaPropertyExpectedTypes(): array |
|
76 | - { |
|
77 | - return [ |
|
78 | - 'additionalType' => ['URL'], |
|
79 | - 'alternateName' => ['Text'], |
|
80 | - 'alternativeOf' => ['Gene'], |
|
81 | - 'associatedDisease' => ['MedicalCondition', 'URL', 'PropertyValue'], |
|
82 | - 'bioChemInteraction' => ['BioChemEntity'], |
|
83 | - 'bioChemSimilarity' => ['BioChemEntity'], |
|
84 | - 'biologicalRole' => ['DefinedTerm'], |
|
85 | - 'description' => ['Text'], |
|
86 | - 'disambiguatingDescription' => ['Text'], |
|
87 | - 'encodesBioChemEntity' => ['BioChemEntity'], |
|
88 | - 'expressedIn' => ['DefinedTerm', 'BioChemEntity', 'AnatomicalSystem', 'AnatomicalStructure'], |
|
89 | - 'funding' => ['Grant'], |
|
90 | - 'hasBioChemEntityPart' => ['BioChemEntity'], |
|
91 | - 'hasBioPolymerSequence' => ['Text'], |
|
92 | - 'hasMolecularFunction' => ['URL', 'DefinedTerm', 'PropertyValue'], |
|
93 | - 'hasRepresentation' => ['Text', 'URL', 'PropertyValue'], |
|
94 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
95 | - 'image' => ['URL', 'ImageObject'], |
|
96 | - 'isEncodedByBioChemEntity' => ['Gene'], |
|
97 | - 'isInvolvedInBiologicalProcess' => ['DefinedTerm', 'PropertyValue', 'URL'], |
|
98 | - 'isLocatedInSubcellularLocation' => ['URL', 'DefinedTerm', 'PropertyValue'], |
|
99 | - 'isPartOfBioChemEntity' => ['BioChemEntity'], |
|
100 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
101 | - 'name' => ['Text'], |
|
102 | - 'potentialAction' => ['Action'], |
|
103 | - 'sameAs' => ['URL'], |
|
104 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
105 | - 'taxonomicRange' => ['URL', 'DefinedTerm', 'Text', 'Taxon'], |
|
106 | - 'url' => ['URL'] |
|
107 | - ]; |
|
108 | - } |
|
109 | - |
|
110 | - |
|
111 | - /** |
|
112 | - * @inheritdoc |
|
113 | - */ |
|
114 | - public function getSchemaPropertyDescriptions(): array |
|
115 | - { |
|
116 | - return [ |
|
117 | - '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.', |
|
118 | - 'alternateName' => 'An alias for the item.', |
|
119 | - 'alternativeOf' => 'Another gene which is a variation of this one.', |
|
120 | - 'associatedDisease' => 'Disease associated to this BioChemEntity. Such disease can be a MedicalCondition or a URL. If you want to add an evidence supporting the association, please use PropertyValue.', |
|
121 | - 'bioChemInteraction' => 'A BioChemEntity that is known to interact with this item.', |
|
122 | - 'bioChemSimilarity' => 'A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms.', |
|
123 | - 'biologicalRole' => 'A role played by the BioChemEntity within a biological context.', |
|
124 | - 'description' => 'A description of the item.', |
|
125 | - '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.', |
|
126 | - 'encodesBioChemEntity' => 'Another BioChemEntity encoded by this one. ', |
|
127 | - 'expressedIn' => 'Tissue, organ, biological sample, etc in which activity of this gene has been observed experimentally. For example brain, digestive system.', |
|
128 | - 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', |
|
129 | - 'hasBioChemEntityPart' => 'Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part. ', |
|
130 | - 'hasBioPolymerSequence' => 'A symbolic representation of a BioChemEntity. For example, a nucleotide sequence of a Gene or an amino acid sequence of a Protein.', |
|
131 | - 'hasMolecularFunction' => 'Molecular function performed by this BioChemEntity; please use PropertyValue if you want to include any evidence.', |
|
132 | - 'hasRepresentation' => 'A common representation such as a protein sequence or chemical structure for this entity. For images use schema.org/image.', |
|
133 | - '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. ', |
|
134 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
135 | - 'isEncodedByBioChemEntity' => 'Another BioChemEntity encoding by this one.', |
|
136 | - 'isInvolvedInBiologicalProcess' => 'Biological process this BioChemEntity is involved in; please use PropertyValue if you want to include any evidence.', |
|
137 | - 'isLocatedInSubcellularLocation' => 'Subcellular location where this BioChemEntity is located; please use PropertyValue if you want to include any evidence.', |
|
138 | - 'isPartOfBioChemEntity' => 'Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity. ', |
|
139 | - '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.', |
|
140 | - 'name' => 'The name of the item.', |
|
141 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
142 | - '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.', |
|
143 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
144 | - 'taxonomicRange' => 'The taxonomic grouping of the organism that expresses, encodes, or in some way related to the BioChemEntity.', |
|
145 | - 'url' => 'URL of the item.' |
|
146 | - ]; |
|
147 | - } |
|
148 | - |
|
149 | - |
|
150 | - /** |
|
151 | - * @inheritdoc |
|
152 | - */ |
|
153 | - public function getGoogleRequiredSchema(): array |
|
154 | - { |
|
155 | - return ['description', 'name']; |
|
156 | - } |
|
157 | - |
|
158 | - |
|
159 | - /** |
|
160 | - * @inheritdoc |
|
161 | - */ |
|
162 | - public function getGoogleRecommendedSchema(): array |
|
163 | - { |
|
164 | - return ['image', 'url']; |
|
165 | - } |
|
166 | - |
|
167 | - |
|
168 | - /** |
|
169 | - * @inheritdoc |
|
170 | - */ |
|
171 | - public function defineRules(): array |
|
172 | - { |
|
173 | - $rules = parent::defineRules(); |
|
174 | - $rules = array_merge($rules, [ |
|
175 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
176 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
177 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
178 | - ]); |
|
179 | - |
|
180 | - return $rules; |
|
181 | - } |
|
30 | + use GeneTrait; |
|
31 | + use BioChemEntityTrait; |
|
32 | + use ThingTrait; |
|
33 | + |
|
34 | + /** |
|
35 | + * The Schema.org Type Name |
|
36 | + * |
|
37 | + * @var string |
|
38 | + */ |
|
39 | + public static string $schemaTypeName = 'Gene'; |
|
40 | + |
|
41 | + /** |
|
42 | + * The Schema.org Type Scope |
|
43 | + * |
|
44 | + * @var string |
|
45 | + */ |
|
46 | + public static string $schemaTypeScope = 'https://schema.org/Gene'; |
|
47 | + |
|
48 | + /** |
|
49 | + * The Schema.org Type Extends |
|
50 | + * |
|
51 | + * @var string |
|
52 | + */ |
|
53 | + public static string $schemaTypeExtends = 'BioChemEntity'; |
|
54 | + |
|
55 | + /** |
|
56 | + * The Schema.org Type Description |
|
57 | + * |
|
58 | + * @var string |
|
59 | + */ |
|
60 | + public static string $schemaTypeDescription = 'A discrete unit of inheritance which affects one or more biological traits (Source: [https://en.wikipedia.org/wiki/Gene](https://en.wikipedia.org/wiki/Gene)). Examples include FOXP2 (Forkhead box protein P2), SCARNA21 (small Cajal body-specific RNA 21), A- (agouti genotype).'; |
|
61 | + |
|
62 | + |
|
63 | + /** |
|
64 | + * @inheritdoc |
|
65 | + */ |
|
66 | + public function getSchemaPropertyNames(): array |
|
67 | + { |
|
68 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
69 | + } |
|
70 | + |
|
71 | + |
|
72 | + /** |
|
73 | + * @inheritdoc |
|
74 | + */ |
|
75 | + public function getSchemaPropertyExpectedTypes(): array |
|
76 | + { |
|
77 | + return [ |
|
78 | + 'additionalType' => ['URL'], |
|
79 | + 'alternateName' => ['Text'], |
|
80 | + 'alternativeOf' => ['Gene'], |
|
81 | + 'associatedDisease' => ['MedicalCondition', 'URL', 'PropertyValue'], |
|
82 | + 'bioChemInteraction' => ['BioChemEntity'], |
|
83 | + 'bioChemSimilarity' => ['BioChemEntity'], |
|
84 | + 'biologicalRole' => ['DefinedTerm'], |
|
85 | + 'description' => ['Text'], |
|
86 | + 'disambiguatingDescription' => ['Text'], |
|
87 | + 'encodesBioChemEntity' => ['BioChemEntity'], |
|
88 | + 'expressedIn' => ['DefinedTerm', 'BioChemEntity', 'AnatomicalSystem', 'AnatomicalStructure'], |
|
89 | + 'funding' => ['Grant'], |
|
90 | + 'hasBioChemEntityPart' => ['BioChemEntity'], |
|
91 | + 'hasBioPolymerSequence' => ['Text'], |
|
92 | + 'hasMolecularFunction' => ['URL', 'DefinedTerm', 'PropertyValue'], |
|
93 | + 'hasRepresentation' => ['Text', 'URL', 'PropertyValue'], |
|
94 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
95 | + 'image' => ['URL', 'ImageObject'], |
|
96 | + 'isEncodedByBioChemEntity' => ['Gene'], |
|
97 | + 'isInvolvedInBiologicalProcess' => ['DefinedTerm', 'PropertyValue', 'URL'], |
|
98 | + 'isLocatedInSubcellularLocation' => ['URL', 'DefinedTerm', 'PropertyValue'], |
|
99 | + 'isPartOfBioChemEntity' => ['BioChemEntity'], |
|
100 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
101 | + 'name' => ['Text'], |
|
102 | + 'potentialAction' => ['Action'], |
|
103 | + 'sameAs' => ['URL'], |
|
104 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
105 | + 'taxonomicRange' => ['URL', 'DefinedTerm', 'Text', 'Taxon'], |
|
106 | + 'url' => ['URL'] |
|
107 | + ]; |
|
108 | + } |
|
109 | + |
|
110 | + |
|
111 | + /** |
|
112 | + * @inheritdoc |
|
113 | + */ |
|
114 | + public function getSchemaPropertyDescriptions(): array |
|
115 | + { |
|
116 | + return [ |
|
117 | + '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.', |
|
118 | + 'alternateName' => 'An alias for the item.', |
|
119 | + 'alternativeOf' => 'Another gene which is a variation of this one.', |
|
120 | + 'associatedDisease' => 'Disease associated to this BioChemEntity. Such disease can be a MedicalCondition or a URL. If you want to add an evidence supporting the association, please use PropertyValue.', |
|
121 | + 'bioChemInteraction' => 'A BioChemEntity that is known to interact with this item.', |
|
122 | + 'bioChemSimilarity' => 'A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms.', |
|
123 | + 'biologicalRole' => 'A role played by the BioChemEntity within a biological context.', |
|
124 | + 'description' => 'A description of the item.', |
|
125 | + '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.', |
|
126 | + 'encodesBioChemEntity' => 'Another BioChemEntity encoded by this one. ', |
|
127 | + 'expressedIn' => 'Tissue, organ, biological sample, etc in which activity of this gene has been observed experimentally. For example brain, digestive system.', |
|
128 | + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', |
|
129 | + 'hasBioChemEntityPart' => 'Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part. ', |
|
130 | + 'hasBioPolymerSequence' => 'A symbolic representation of a BioChemEntity. For example, a nucleotide sequence of a Gene or an amino acid sequence of a Protein.', |
|
131 | + 'hasMolecularFunction' => 'Molecular function performed by this BioChemEntity; please use PropertyValue if you want to include any evidence.', |
|
132 | + 'hasRepresentation' => 'A common representation such as a protein sequence or chemical structure for this entity. For images use schema.org/image.', |
|
133 | + '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. ', |
|
134 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
135 | + 'isEncodedByBioChemEntity' => 'Another BioChemEntity encoding by this one.', |
|
136 | + 'isInvolvedInBiologicalProcess' => 'Biological process this BioChemEntity is involved in; please use PropertyValue if you want to include any evidence.', |
|
137 | + 'isLocatedInSubcellularLocation' => 'Subcellular location where this BioChemEntity is located; please use PropertyValue if you want to include any evidence.', |
|
138 | + 'isPartOfBioChemEntity' => 'Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity. ', |
|
139 | + '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.', |
|
140 | + 'name' => 'The name of the item.', |
|
141 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
142 | + '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.', |
|
143 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
144 | + 'taxonomicRange' => 'The taxonomic grouping of the organism that expresses, encodes, or in some way related to the BioChemEntity.', |
|
145 | + 'url' => 'URL of the item.' |
|
146 | + ]; |
|
147 | + } |
|
148 | + |
|
149 | + |
|
150 | + /** |
|
151 | + * @inheritdoc |
|
152 | + */ |
|
153 | + public function getGoogleRequiredSchema(): array |
|
154 | + { |
|
155 | + return ['description', 'name']; |
|
156 | + } |
|
157 | + |
|
158 | + |
|
159 | + /** |
|
160 | + * @inheritdoc |
|
161 | + */ |
|
162 | + public function getGoogleRecommendedSchema(): array |
|
163 | + { |
|
164 | + return ['image', 'url']; |
|
165 | + } |
|
166 | + |
|
167 | + |
|
168 | + /** |
|
169 | + * @inheritdoc |
|
170 | + */ |
|
171 | + public function defineRules(): array |
|
172 | + { |
|
173 | + $rules = parent::defineRules(); |
|
174 | + $rules = array_merge($rules, [ |
|
175 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
176 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
177 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
178 | + ]); |
|
179 | + |
|
180 | + return $rules; |
|
181 | + } |
|
182 | 182 | } |
@@ -34,128 +34,128 @@ |
||
34 | 34 | */ |
35 | 35 | class Grant extends MetaJsonLd implements GrantInterface, IntangibleInterface, ThingInterface |
36 | 36 | { |
37 | - use GrantTrait; |
|
38 | - use IntangibleTrait; |
|
39 | - use ThingTrait; |
|
40 | - |
|
41 | - /** |
|
42 | - * The Schema.org Type Name |
|
43 | - * |
|
44 | - * @var string |
|
45 | - */ |
|
46 | - public static string $schemaTypeName = 'Grant'; |
|
47 | - |
|
48 | - /** |
|
49 | - * The Schema.org Type Scope |
|
50 | - * |
|
51 | - * @var string |
|
52 | - */ |
|
53 | - public static string $schemaTypeScope = 'https://schema.org/Grant'; |
|
54 | - |
|
55 | - /** |
|
56 | - * The Schema.org Type Extends |
|
57 | - * |
|
58 | - * @var string |
|
59 | - */ |
|
60 | - public static string $schemaTypeExtends = 'Intangible'; |
|
61 | - |
|
62 | - /** |
|
63 | - * The Schema.org Type Description |
|
64 | - * |
|
65 | - * @var string |
|
66 | - */ |
|
67 | - public static string $schemaTypeDescription = "A grant, typically financial or otherwise quantifiable, of resources. Typically a [[funder]] sponsors some [[MonetaryAmount]] to an [[Organization]] or [[Person]],\n sometimes not necessarily via a dedicated or long-lived [[Project]], resulting in one or more outputs, or [[fundedItem]]s. For financial sponsorship, indicate the [[funder]] of a [[MonetaryGrant]]. For non-financial support, indicate [[sponsor]] of [[Grant]]s of resources (e.g. office space).\n\nGrants support activities directed towards some agreed collective goals, often but not always organized as [[Project]]s. Long-lived projects are sometimes sponsored by a variety of grants over time, but it is also common for a project to be associated with a single grant.\n\nThe amount of a [[Grant]] is represented using [[amount]] as a [[MonetaryAmount]].\n "; |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * @inheritdoc |
|
72 | - */ |
|
73 | - public function getSchemaPropertyNames(): array |
|
74 | - { |
|
75 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - /** |
|
80 | - * @inheritdoc |
|
81 | - */ |
|
82 | - public function getSchemaPropertyExpectedTypes(): array |
|
83 | - { |
|
84 | - return [ |
|
85 | - 'additionalType' => ['URL'], |
|
86 | - 'alternateName' => ['Text'], |
|
87 | - 'description' => ['Text'], |
|
88 | - 'disambiguatingDescription' => ['Text'], |
|
89 | - 'fundedItem' => ['Organization', 'BioChemEntity', 'Event', 'Person', 'MedicalEntity', 'Product', 'CreativeWork'], |
|
90 | - 'funder' => ['Organization', 'Person'], |
|
91 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
92 | - 'image' => ['URL', 'ImageObject'], |
|
93 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
94 | - 'name' => ['Text'], |
|
95 | - 'potentialAction' => ['Action'], |
|
96 | - 'sameAs' => ['URL'], |
|
97 | - 'sponsor' => ['Organization', 'Person'], |
|
98 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
99 | - 'url' => ['URL'] |
|
100 | - ]; |
|
101 | - } |
|
102 | - |
|
103 | - |
|
104 | - /** |
|
105 | - * @inheritdoc |
|
106 | - */ |
|
107 | - public function getSchemaPropertyDescriptions(): array |
|
108 | - { |
|
109 | - return [ |
|
110 | - '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.', |
|
111 | - 'alternateName' => 'An alias for the item.', |
|
112 | - 'description' => 'A description of the item.', |
|
113 | - '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.', |
|
114 | - 'fundedItem' => 'Indicates something directly or indirectly funded or sponsored through a [[Grant]]. See also [[ownershipFundingInfo]].', |
|
115 | - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', |
|
116 | - '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. ', |
|
117 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
118 | - '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.', |
|
119 | - 'name' => 'The name of the item.', |
|
120 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
121 | - '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.', |
|
122 | - 'sponsor' => 'A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.', |
|
123 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
124 | - 'url' => 'URL of the item.' |
|
125 | - ]; |
|
126 | - } |
|
127 | - |
|
128 | - |
|
129 | - /** |
|
130 | - * @inheritdoc |
|
131 | - */ |
|
132 | - public function getGoogleRequiredSchema(): array |
|
133 | - { |
|
134 | - return ['description', 'name']; |
|
135 | - } |
|
136 | - |
|
137 | - |
|
138 | - /** |
|
139 | - * @inheritdoc |
|
140 | - */ |
|
141 | - public function getGoogleRecommendedSchema(): array |
|
142 | - { |
|
143 | - return ['image', 'url']; |
|
144 | - } |
|
145 | - |
|
146 | - |
|
147 | - /** |
|
148 | - * @inheritdoc |
|
149 | - */ |
|
150 | - public function defineRules(): array |
|
151 | - { |
|
152 | - $rules = parent::defineRules(); |
|
153 | - $rules = array_merge($rules, [ |
|
154 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
155 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
156 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
157 | - ]); |
|
158 | - |
|
159 | - return $rules; |
|
160 | - } |
|
37 | + use GrantTrait; |
|
38 | + use IntangibleTrait; |
|
39 | + use ThingTrait; |
|
40 | + |
|
41 | + /** |
|
42 | + * The Schema.org Type Name |
|
43 | + * |
|
44 | + * @var string |
|
45 | + */ |
|
46 | + public static string $schemaTypeName = 'Grant'; |
|
47 | + |
|
48 | + /** |
|
49 | + * The Schema.org Type Scope |
|
50 | + * |
|
51 | + * @var string |
|
52 | + */ |
|
53 | + public static string $schemaTypeScope = 'https://schema.org/Grant'; |
|
54 | + |
|
55 | + /** |
|
56 | + * The Schema.org Type Extends |
|
57 | + * |
|
58 | + * @var string |
|
59 | + */ |
|
60 | + public static string $schemaTypeExtends = 'Intangible'; |
|
61 | + |
|
62 | + /** |
|
63 | + * The Schema.org Type Description |
|
64 | + * |
|
65 | + * @var string |
|
66 | + */ |
|
67 | + public static string $schemaTypeDescription = "A grant, typically financial or otherwise quantifiable, of resources. Typically a [[funder]] sponsors some [[MonetaryAmount]] to an [[Organization]] or [[Person]],\n sometimes not necessarily via a dedicated or long-lived [[Project]], resulting in one or more outputs, or [[fundedItem]]s. For financial sponsorship, indicate the [[funder]] of a [[MonetaryGrant]]. For non-financial support, indicate [[sponsor]] of [[Grant]]s of resources (e.g. office space).\n\nGrants support activities directed towards some agreed collective goals, often but not always organized as [[Project]]s. Long-lived projects are sometimes sponsored by a variety of grants over time, but it is also common for a project to be associated with a single grant.\n\nThe amount of a [[Grant]] is represented using [[amount]] as a [[MonetaryAmount]].\n "; |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * @inheritdoc |
|
72 | + */ |
|
73 | + public function getSchemaPropertyNames(): array |
|
74 | + { |
|
75 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + /** |
|
80 | + * @inheritdoc |
|
81 | + */ |
|
82 | + public function getSchemaPropertyExpectedTypes(): array |
|
83 | + { |
|
84 | + return [ |
|
85 | + 'additionalType' => ['URL'], |
|
86 | + 'alternateName' => ['Text'], |
|
87 | + 'description' => ['Text'], |
|
88 | + 'disambiguatingDescription' => ['Text'], |
|
89 | + 'fundedItem' => ['Organization', 'BioChemEntity', 'Event', 'Person', 'MedicalEntity', 'Product', 'CreativeWork'], |
|
90 | + 'funder' => ['Organization', 'Person'], |
|
91 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
92 | + 'image' => ['URL', 'ImageObject'], |
|
93 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
94 | + 'name' => ['Text'], |
|
95 | + 'potentialAction' => ['Action'], |
|
96 | + 'sameAs' => ['URL'], |
|
97 | + 'sponsor' => ['Organization', 'Person'], |
|
98 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
99 | + 'url' => ['URL'] |
|
100 | + ]; |
|
101 | + } |
|
102 | + |
|
103 | + |
|
104 | + /** |
|
105 | + * @inheritdoc |
|
106 | + */ |
|
107 | + public function getSchemaPropertyDescriptions(): array |
|
108 | + { |
|
109 | + return [ |
|
110 | + '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.', |
|
111 | + 'alternateName' => 'An alias for the item.', |
|
112 | + 'description' => 'A description of the item.', |
|
113 | + '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.', |
|
114 | + 'fundedItem' => 'Indicates something directly or indirectly funded or sponsored through a [[Grant]]. See also [[ownershipFundingInfo]].', |
|
115 | + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', |
|
116 | + '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. ', |
|
117 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
118 | + '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.', |
|
119 | + 'name' => 'The name of the item.', |
|
120 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
121 | + '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.', |
|
122 | + 'sponsor' => 'A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.', |
|
123 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
124 | + 'url' => 'URL of the item.' |
|
125 | + ]; |
|
126 | + } |
|
127 | + |
|
128 | + |
|
129 | + /** |
|
130 | + * @inheritdoc |
|
131 | + */ |
|
132 | + public function getGoogleRequiredSchema(): array |
|
133 | + { |
|
134 | + return ['description', 'name']; |
|
135 | + } |
|
136 | + |
|
137 | + |
|
138 | + /** |
|
139 | + * @inheritdoc |
|
140 | + */ |
|
141 | + public function getGoogleRecommendedSchema(): array |
|
142 | + { |
|
143 | + return ['image', 'url']; |
|
144 | + } |
|
145 | + |
|
146 | + |
|
147 | + /** |
|
148 | + * @inheritdoc |
|
149 | + */ |
|
150 | + public function defineRules(): array |
|
151 | + { |
|
152 | + $rules = parent::defineRules(); |
|
153 | + $rules = array_merge($rules, [ |
|
154 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
155 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
156 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
157 | + ]); |
|
158 | + |
|
159 | + return $rules; |
|
160 | + } |
|
161 | 161 | } |
@@ -26,139 +26,139 @@ |
||
26 | 26 | */ |
27 | 27 | class GeoShape extends MetaJsonLd implements GeoShapeInterface, StructuredValueInterface, IntangibleInterface, ThingInterface |
28 | 28 | { |
29 | - use GeoShapeTrait; |
|
30 | - use StructuredValueTrait; |
|
31 | - use IntangibleTrait; |
|
32 | - use ThingTrait; |
|
33 | - |
|
34 | - /** |
|
35 | - * The Schema.org Type Name |
|
36 | - * |
|
37 | - * @var string |
|
38 | - */ |
|
39 | - public static string $schemaTypeName = 'GeoShape'; |
|
40 | - |
|
41 | - /** |
|
42 | - * The Schema.org Type Scope |
|
43 | - * |
|
44 | - * @var string |
|
45 | - */ |
|
46 | - public static string $schemaTypeScope = 'https://schema.org/GeoShape'; |
|
47 | - |
|
48 | - /** |
|
49 | - * The Schema.org Type Extends |
|
50 | - * |
|
51 | - * @var string |
|
52 | - */ |
|
53 | - public static string $schemaTypeExtends = 'StructuredValue'; |
|
54 | - |
|
55 | - /** |
|
56 | - * The Schema.org Type Description |
|
57 | - * |
|
58 | - * @var string |
|
59 | - */ |
|
60 | - public static string $schemaTypeDescription = 'The geographic shape of a place. A GeoShape can be described using several properties whose values are based on latitude/longitude pairs. Either whitespace or commas can be used to separate latitude and longitude; whitespace should be used when writing a list of several such points.'; |
|
61 | - |
|
62 | - |
|
63 | - /** |
|
64 | - * @inheritdoc |
|
65 | - */ |
|
66 | - public function getSchemaPropertyNames(): array |
|
67 | - { |
|
68 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
69 | - } |
|
70 | - |
|
71 | - |
|
72 | - /** |
|
73 | - * @inheritdoc |
|
74 | - */ |
|
75 | - public function getSchemaPropertyExpectedTypes(): array |
|
76 | - { |
|
77 | - return [ |
|
78 | - 'additionalType' => ['URL'], |
|
79 | - 'address' => ['Text', 'PostalAddress'], |
|
80 | - 'addressCountry' => ['Country', 'Text'], |
|
81 | - 'alternateName' => ['Text'], |
|
82 | - 'box' => ['Text'], |
|
83 | - 'circle' => ['Text'], |
|
84 | - 'description' => ['Text'], |
|
85 | - 'disambiguatingDescription' => ['Text'], |
|
86 | - 'elevation' => ['Number', 'Text'], |
|
87 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
88 | - 'image' => ['URL', 'ImageObject'], |
|
89 | - 'line' => ['Text'], |
|
90 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
91 | - 'name' => ['Text'], |
|
92 | - 'polygon' => ['Text'], |
|
93 | - 'postalCode' => ['Text'], |
|
94 | - 'potentialAction' => ['Action'], |
|
95 | - 'sameAs' => ['URL'], |
|
96 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
97 | - 'url' => ['URL'] |
|
98 | - ]; |
|
99 | - } |
|
100 | - |
|
101 | - |
|
102 | - /** |
|
103 | - * @inheritdoc |
|
104 | - */ |
|
105 | - public function getSchemaPropertyDescriptions(): array |
|
106 | - { |
|
107 | - return [ |
|
108 | - '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.', |
|
109 | - 'address' => 'Physical address of the item.', |
|
110 | - 'addressCountry' => 'The country. For example, USA. You can also provide the two-letter [ISO 3166-1 alpha-2 country code](http://en.wikipedia.org/wiki/ISO_3166-1).', |
|
111 | - 'alternateName' => 'An alias for the item.', |
|
112 | - 'box' => 'A box is the area enclosed by the rectangle formed by two points. The first point is the lower corner, the second point is the upper corner. A box is expressed as two points separated by a space character.', |
|
113 | - 'circle' => 'A circle is the circular region of a specified radius centered at a specified latitude and longitude. A circle is expressed as a pair followed by a radius in meters.', |
|
114 | - 'description' => 'A description of the item.', |
|
115 | - '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.', |
|
116 | - 'elevation' => 'The elevation of a location ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)). Values may be of the form \'NUMBER UNIT\_OF\_MEASUREMENT\' (e.g., \'1,000 m\', \'3,200 ft\') while numbers alone should be assumed to be a value in meters.', |
|
117 | - '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. ', |
|
118 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
119 | - 'line' => 'A line is a point-to-point path consisting of two or more points. A line is expressed as a series of two or more point objects separated by space.', |
|
120 | - '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.', |
|
121 | - 'name' => 'The name of the item.', |
|
122 | - 'polygon' => 'A polygon is the area enclosed by a point-to-point path for which the starting and ending points are the same. A polygon is expressed as a series of four or more space delimited points where the first and final points are identical.', |
|
123 | - 'postalCode' => 'The postal code. For example, 94043.', |
|
124 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
125 | - '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.', |
|
126 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
127 | - 'url' => 'URL of the item.' |
|
128 | - ]; |
|
129 | - } |
|
130 | - |
|
131 | - |
|
132 | - /** |
|
133 | - * @inheritdoc |
|
134 | - */ |
|
135 | - public function getGoogleRequiredSchema(): array |
|
136 | - { |
|
137 | - return ['description', 'name']; |
|
138 | - } |
|
139 | - |
|
140 | - |
|
141 | - /** |
|
142 | - * @inheritdoc |
|
143 | - */ |
|
144 | - public function getGoogleRecommendedSchema(): array |
|
145 | - { |
|
146 | - return ['image', 'url']; |
|
147 | - } |
|
148 | - |
|
149 | - |
|
150 | - /** |
|
151 | - * @inheritdoc |
|
152 | - */ |
|
153 | - public function defineRules(): array |
|
154 | - { |
|
155 | - $rules = parent::defineRules(); |
|
156 | - $rules = array_merge($rules, [ |
|
157 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
158 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
159 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
160 | - ]); |
|
161 | - |
|
162 | - return $rules; |
|
163 | - } |
|
29 | + use GeoShapeTrait; |
|
30 | + use StructuredValueTrait; |
|
31 | + use IntangibleTrait; |
|
32 | + use ThingTrait; |
|
33 | + |
|
34 | + /** |
|
35 | + * The Schema.org Type Name |
|
36 | + * |
|
37 | + * @var string |
|
38 | + */ |
|
39 | + public static string $schemaTypeName = 'GeoShape'; |
|
40 | + |
|
41 | + /** |
|
42 | + * The Schema.org Type Scope |
|
43 | + * |
|
44 | + * @var string |
|
45 | + */ |
|
46 | + public static string $schemaTypeScope = 'https://schema.org/GeoShape'; |
|
47 | + |
|
48 | + /** |
|
49 | + * The Schema.org Type Extends |
|
50 | + * |
|
51 | + * @var string |
|
52 | + */ |
|
53 | + public static string $schemaTypeExtends = 'StructuredValue'; |
|
54 | + |
|
55 | + /** |
|
56 | + * The Schema.org Type Description |
|
57 | + * |
|
58 | + * @var string |
|
59 | + */ |
|
60 | + public static string $schemaTypeDescription = 'The geographic shape of a place. A GeoShape can be described using several properties whose values are based on latitude/longitude pairs. Either whitespace or commas can be used to separate latitude and longitude; whitespace should be used when writing a list of several such points.'; |
|
61 | + |
|
62 | + |
|
63 | + /** |
|
64 | + * @inheritdoc |
|
65 | + */ |
|
66 | + public function getSchemaPropertyNames(): array |
|
67 | + { |
|
68 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
69 | + } |
|
70 | + |
|
71 | + |
|
72 | + /** |
|
73 | + * @inheritdoc |
|
74 | + */ |
|
75 | + public function getSchemaPropertyExpectedTypes(): array |
|
76 | + { |
|
77 | + return [ |
|
78 | + 'additionalType' => ['URL'], |
|
79 | + 'address' => ['Text', 'PostalAddress'], |
|
80 | + 'addressCountry' => ['Country', 'Text'], |
|
81 | + 'alternateName' => ['Text'], |
|
82 | + 'box' => ['Text'], |
|
83 | + 'circle' => ['Text'], |
|
84 | + 'description' => ['Text'], |
|
85 | + 'disambiguatingDescription' => ['Text'], |
|
86 | + 'elevation' => ['Number', 'Text'], |
|
87 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
88 | + 'image' => ['URL', 'ImageObject'], |
|
89 | + 'line' => ['Text'], |
|
90 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
91 | + 'name' => ['Text'], |
|
92 | + 'polygon' => ['Text'], |
|
93 | + 'postalCode' => ['Text'], |
|
94 | + 'potentialAction' => ['Action'], |
|
95 | + 'sameAs' => ['URL'], |
|
96 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
97 | + 'url' => ['URL'] |
|
98 | + ]; |
|
99 | + } |
|
100 | + |
|
101 | + |
|
102 | + /** |
|
103 | + * @inheritdoc |
|
104 | + */ |
|
105 | + public function getSchemaPropertyDescriptions(): array |
|
106 | + { |
|
107 | + return [ |
|
108 | + '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.', |
|
109 | + 'address' => 'Physical address of the item.', |
|
110 | + 'addressCountry' => 'The country. For example, USA. You can also provide the two-letter [ISO 3166-1 alpha-2 country code](http://en.wikipedia.org/wiki/ISO_3166-1).', |
|
111 | + 'alternateName' => 'An alias for the item.', |
|
112 | + 'box' => 'A box is the area enclosed by the rectangle formed by two points. The first point is the lower corner, the second point is the upper corner. A box is expressed as two points separated by a space character.', |
|
113 | + 'circle' => 'A circle is the circular region of a specified radius centered at a specified latitude and longitude. A circle is expressed as a pair followed by a radius in meters.', |
|
114 | + 'description' => 'A description of the item.', |
|
115 | + '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.', |
|
116 | + 'elevation' => 'The elevation of a location ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)). Values may be of the form \'NUMBER UNIT\_OF\_MEASUREMENT\' (e.g., \'1,000 m\', \'3,200 ft\') while numbers alone should be assumed to be a value in meters.', |
|
117 | + '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. ', |
|
118 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
119 | + 'line' => 'A line is a point-to-point path consisting of two or more points. A line is expressed as a series of two or more point objects separated by space.', |
|
120 | + '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.', |
|
121 | + 'name' => 'The name of the item.', |
|
122 | + 'polygon' => 'A polygon is the area enclosed by a point-to-point path for which the starting and ending points are the same. A polygon is expressed as a series of four or more space delimited points where the first and final points are identical.', |
|
123 | + 'postalCode' => 'The postal code. For example, 94043.', |
|
124 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
125 | + '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.', |
|
126 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
127 | + 'url' => 'URL of the item.' |
|
128 | + ]; |
|
129 | + } |
|
130 | + |
|
131 | + |
|
132 | + /** |
|
133 | + * @inheritdoc |
|
134 | + */ |
|
135 | + public function getGoogleRequiredSchema(): array |
|
136 | + { |
|
137 | + return ['description', 'name']; |
|
138 | + } |
|
139 | + |
|
140 | + |
|
141 | + /** |
|
142 | + * @inheritdoc |
|
143 | + */ |
|
144 | + public function getGoogleRecommendedSchema(): array |
|
145 | + { |
|
146 | + return ['image', 'url']; |
|
147 | + } |
|
148 | + |
|
149 | + |
|
150 | + /** |
|
151 | + * @inheritdoc |
|
152 | + */ |
|
153 | + public function defineRules(): array |
|
154 | + { |
|
155 | + $rules = parent::defineRules(); |
|
156 | + $rules = array_merge($rules, [ |
|
157 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
158 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
159 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
160 | + ]); |
|
161 | + |
|
162 | + return $rules; |
|
163 | + } |
|
164 | 164 | } |
@@ -23,126 +23,126 @@ |
||
23 | 23 | */ |
24 | 24 | class MedicineSystem extends MetaJsonLd implements MedicineSystemInterface, MedicalEnumerationInterface, EnumerationInterface, IntangibleInterface, ThingInterface |
25 | 25 | { |
26 | - use MedicineSystemTrait; |
|
27 | - use MedicalEnumerationTrait; |
|
28 | - use EnumerationTrait; |
|
29 | - use IntangibleTrait; |
|
30 | - use ThingTrait; |
|
31 | - |
|
32 | - /** |
|
33 | - * The Schema.org Type Name |
|
34 | - * |
|
35 | - * @var string |
|
36 | - */ |
|
37 | - public static string $schemaTypeName = 'MedicineSystem'; |
|
38 | - |
|
39 | - /** |
|
40 | - * The Schema.org Type Scope |
|
41 | - * |
|
42 | - * @var string |
|
43 | - */ |
|
44 | - public static string $schemaTypeScope = 'https://schema.org/MedicineSystem'; |
|
45 | - |
|
46 | - /** |
|
47 | - * The Schema.org Type Extends |
|
48 | - * |
|
49 | - * @var string |
|
50 | - */ |
|
51 | - public static string $schemaTypeExtends = 'MedicalEnumeration'; |
|
52 | - |
|
53 | - /** |
|
54 | - * The Schema.org Type Description |
|
55 | - * |
|
56 | - * @var string |
|
57 | - */ |
|
58 | - public static string $schemaTypeDescription = 'Systems of medical practice.'; |
|
59 | - |
|
60 | - |
|
61 | - /** |
|
62 | - * @inheritdoc |
|
63 | - */ |
|
64 | - public function getSchemaPropertyNames(): array |
|
65 | - { |
|
66 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * @inheritdoc |
|
72 | - */ |
|
73 | - public function getSchemaPropertyExpectedTypes(): array |
|
74 | - { |
|
75 | - return [ |
|
76 | - 'additionalType' => ['URL'], |
|
77 | - 'alternateName' => ['Text'], |
|
78 | - 'description' => ['Text'], |
|
79 | - 'disambiguatingDescription' => ['Text'], |
|
80 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
81 | - 'image' => ['URL', 'ImageObject'], |
|
82 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
83 | - 'name' => ['Text'], |
|
84 | - 'potentialAction' => ['Action'], |
|
85 | - 'sameAs' => ['URL'], |
|
86 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
87 | - 'supersededBy' => ['Class', 'Property', 'Enumeration'], |
|
88 | - 'url' => ['URL'] |
|
89 | - ]; |
|
90 | - } |
|
91 | - |
|
92 | - |
|
93 | - /** |
|
94 | - * @inheritdoc |
|
95 | - */ |
|
96 | - public function getSchemaPropertyDescriptions(): array |
|
97 | - { |
|
98 | - return [ |
|
99 | - '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.', |
|
100 | - 'alternateName' => 'An alias for the item.', |
|
101 | - 'description' => 'A description of the item.', |
|
102 | - '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.', |
|
103 | - '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. ', |
|
104 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
105 | - '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.', |
|
106 | - 'name' => 'The name of the item.', |
|
107 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
108 | - '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.', |
|
109 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
110 | - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', |
|
111 | - 'url' => 'URL of the item.' |
|
112 | - ]; |
|
113 | - } |
|
114 | - |
|
115 | - |
|
116 | - /** |
|
117 | - * @inheritdoc |
|
118 | - */ |
|
119 | - public function getGoogleRequiredSchema(): array |
|
120 | - { |
|
121 | - return ['description', 'name']; |
|
122 | - } |
|
123 | - |
|
124 | - |
|
125 | - /** |
|
126 | - * @inheritdoc |
|
127 | - */ |
|
128 | - public function getGoogleRecommendedSchema(): array |
|
129 | - { |
|
130 | - return ['image', 'url']; |
|
131 | - } |
|
132 | - |
|
133 | - |
|
134 | - /** |
|
135 | - * @inheritdoc |
|
136 | - */ |
|
137 | - public function defineRules(): array |
|
138 | - { |
|
139 | - $rules = parent::defineRules(); |
|
140 | - $rules = array_merge($rules, [ |
|
141 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
142 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
143 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
144 | - ]); |
|
145 | - |
|
146 | - return $rules; |
|
147 | - } |
|
26 | + use MedicineSystemTrait; |
|
27 | + use MedicalEnumerationTrait; |
|
28 | + use EnumerationTrait; |
|
29 | + use IntangibleTrait; |
|
30 | + use ThingTrait; |
|
31 | + |
|
32 | + /** |
|
33 | + * The Schema.org Type Name |
|
34 | + * |
|
35 | + * @var string |
|
36 | + */ |
|
37 | + public static string $schemaTypeName = 'MedicineSystem'; |
|
38 | + |
|
39 | + /** |
|
40 | + * The Schema.org Type Scope |
|
41 | + * |
|
42 | + * @var string |
|
43 | + */ |
|
44 | + public static string $schemaTypeScope = 'https://schema.org/MedicineSystem'; |
|
45 | + |
|
46 | + /** |
|
47 | + * The Schema.org Type Extends |
|
48 | + * |
|
49 | + * @var string |
|
50 | + */ |
|
51 | + public static string $schemaTypeExtends = 'MedicalEnumeration'; |
|
52 | + |
|
53 | + /** |
|
54 | + * The Schema.org Type Description |
|
55 | + * |
|
56 | + * @var string |
|
57 | + */ |
|
58 | + public static string $schemaTypeDescription = 'Systems of medical practice.'; |
|
59 | + |
|
60 | + |
|
61 | + /** |
|
62 | + * @inheritdoc |
|
63 | + */ |
|
64 | + public function getSchemaPropertyNames(): array |
|
65 | + { |
|
66 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * @inheritdoc |
|
72 | + */ |
|
73 | + public function getSchemaPropertyExpectedTypes(): array |
|
74 | + { |
|
75 | + return [ |
|
76 | + 'additionalType' => ['URL'], |
|
77 | + 'alternateName' => ['Text'], |
|
78 | + 'description' => ['Text'], |
|
79 | + 'disambiguatingDescription' => ['Text'], |
|
80 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
81 | + 'image' => ['URL', 'ImageObject'], |
|
82 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
83 | + 'name' => ['Text'], |
|
84 | + 'potentialAction' => ['Action'], |
|
85 | + 'sameAs' => ['URL'], |
|
86 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
87 | + 'supersededBy' => ['Class', 'Property', 'Enumeration'], |
|
88 | + 'url' => ['URL'] |
|
89 | + ]; |
|
90 | + } |
|
91 | + |
|
92 | + |
|
93 | + /** |
|
94 | + * @inheritdoc |
|
95 | + */ |
|
96 | + public function getSchemaPropertyDescriptions(): array |
|
97 | + { |
|
98 | + return [ |
|
99 | + '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.', |
|
100 | + 'alternateName' => 'An alias for the item.', |
|
101 | + 'description' => 'A description of the item.', |
|
102 | + '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.', |
|
103 | + '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. ', |
|
104 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
105 | + '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.', |
|
106 | + 'name' => 'The name of the item.', |
|
107 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
108 | + '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.', |
|
109 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
110 | + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', |
|
111 | + 'url' => 'URL of the item.' |
|
112 | + ]; |
|
113 | + } |
|
114 | + |
|
115 | + |
|
116 | + /** |
|
117 | + * @inheritdoc |
|
118 | + */ |
|
119 | + public function getGoogleRequiredSchema(): array |
|
120 | + { |
|
121 | + return ['description', 'name']; |
|
122 | + } |
|
123 | + |
|
124 | + |
|
125 | + /** |
|
126 | + * @inheritdoc |
|
127 | + */ |
|
128 | + public function getGoogleRecommendedSchema(): array |
|
129 | + { |
|
130 | + return ['image', 'url']; |
|
131 | + } |
|
132 | + |
|
133 | + |
|
134 | + /** |
|
135 | + * @inheritdoc |
|
136 | + */ |
|
137 | + public function defineRules(): array |
|
138 | + { |
|
139 | + $rules = parent::defineRules(); |
|
140 | + $rules = array_merge($rules, [ |
|
141 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
142 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
143 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
144 | + ]); |
|
145 | + |
|
146 | + return $rules; |
|
147 | + } |
|
148 | 148 | } |
@@ -23,127 +23,127 @@ |
||
23 | 23 | */ |
24 | 24 | class InForce extends MetaJsonLd implements InForceInterface, LegalForceStatusInterface, StatusEnumerationInterface, EnumerationInterface, IntangibleInterface, ThingInterface |
25 | 25 | { |
26 | - use InForceTrait; |
|
27 | - use LegalForceStatusTrait; |
|
28 | - use StatusEnumerationTrait; |
|
29 | - use EnumerationTrait; |
|
30 | - use IntangibleTrait; |
|
31 | - use ThingTrait; |
|
32 | - |
|
33 | - /** |
|
34 | - * The Schema.org Type Name |
|
35 | - * |
|
36 | - * @var string |
|
37 | - */ |
|
38 | - public static string $schemaTypeName = 'InForce'; |
|
39 | - |
|
40 | - /** |
|
41 | - * The Schema.org Type Scope |
|
42 | - * |
|
43 | - * @var string |
|
44 | - */ |
|
45 | - public static string $schemaTypeScope = 'https://schema.org/InForce'; |
|
46 | - |
|
47 | - /** |
|
48 | - * The Schema.org Type Extends |
|
49 | - * |
|
50 | - * @var string |
|
51 | - */ |
|
52 | - public static string $schemaTypeExtends = 'LegalForceStatus'; |
|
53 | - |
|
54 | - /** |
|
55 | - * The Schema.org Type Description |
|
56 | - * |
|
57 | - * @var string |
|
58 | - */ |
|
59 | - public static string $schemaTypeDescription = 'Indicates that a legislation is in force.'; |
|
60 | - |
|
61 | - |
|
62 | - /** |
|
63 | - * @inheritdoc |
|
64 | - */ |
|
65 | - public function getSchemaPropertyNames(): array |
|
66 | - { |
|
67 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
68 | - } |
|
69 | - |
|
70 | - |
|
71 | - /** |
|
72 | - * @inheritdoc |
|
73 | - */ |
|
74 | - public function getSchemaPropertyExpectedTypes(): array |
|
75 | - { |
|
76 | - return [ |
|
77 | - 'additionalType' => ['URL'], |
|
78 | - 'alternateName' => ['Text'], |
|
79 | - 'description' => ['Text'], |
|
80 | - 'disambiguatingDescription' => ['Text'], |
|
81 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
82 | - 'image' => ['URL', 'ImageObject'], |
|
83 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
84 | - 'name' => ['Text'], |
|
85 | - 'potentialAction' => ['Action'], |
|
86 | - 'sameAs' => ['URL'], |
|
87 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
88 | - 'supersededBy' => ['Class', 'Property', 'Enumeration'], |
|
89 | - 'url' => ['URL'] |
|
90 | - ]; |
|
91 | - } |
|
92 | - |
|
93 | - |
|
94 | - /** |
|
95 | - * @inheritdoc |
|
96 | - */ |
|
97 | - public function getSchemaPropertyDescriptions(): array |
|
98 | - { |
|
99 | - return [ |
|
100 | - '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.', |
|
101 | - 'alternateName' => 'An alias for the item.', |
|
102 | - 'description' => 'A description of the item.', |
|
103 | - '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.', |
|
104 | - '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. ', |
|
105 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
106 | - '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.', |
|
107 | - 'name' => 'The name of the item.', |
|
108 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
109 | - '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.', |
|
110 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
111 | - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', |
|
112 | - 'url' => 'URL of the item.' |
|
113 | - ]; |
|
114 | - } |
|
115 | - |
|
116 | - |
|
117 | - /** |
|
118 | - * @inheritdoc |
|
119 | - */ |
|
120 | - public function getGoogleRequiredSchema(): array |
|
121 | - { |
|
122 | - return ['description', 'name']; |
|
123 | - } |
|
124 | - |
|
125 | - |
|
126 | - /** |
|
127 | - * @inheritdoc |
|
128 | - */ |
|
129 | - public function getGoogleRecommendedSchema(): array |
|
130 | - { |
|
131 | - return ['image', 'url']; |
|
132 | - } |
|
133 | - |
|
134 | - |
|
135 | - /** |
|
136 | - * @inheritdoc |
|
137 | - */ |
|
138 | - public function defineRules(): array |
|
139 | - { |
|
140 | - $rules = parent::defineRules(); |
|
141 | - $rules = array_merge($rules, [ |
|
142 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
143 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
144 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
145 | - ]); |
|
146 | - |
|
147 | - return $rules; |
|
148 | - } |
|
26 | + use InForceTrait; |
|
27 | + use LegalForceStatusTrait; |
|
28 | + use StatusEnumerationTrait; |
|
29 | + use EnumerationTrait; |
|
30 | + use IntangibleTrait; |
|
31 | + use ThingTrait; |
|
32 | + |
|
33 | + /** |
|
34 | + * The Schema.org Type Name |
|
35 | + * |
|
36 | + * @var string |
|
37 | + */ |
|
38 | + public static string $schemaTypeName = 'InForce'; |
|
39 | + |
|
40 | + /** |
|
41 | + * The Schema.org Type Scope |
|
42 | + * |
|
43 | + * @var string |
|
44 | + */ |
|
45 | + public static string $schemaTypeScope = 'https://schema.org/InForce'; |
|
46 | + |
|
47 | + /** |
|
48 | + * The Schema.org Type Extends |
|
49 | + * |
|
50 | + * @var string |
|
51 | + */ |
|
52 | + public static string $schemaTypeExtends = 'LegalForceStatus'; |
|
53 | + |
|
54 | + /** |
|
55 | + * The Schema.org Type Description |
|
56 | + * |
|
57 | + * @var string |
|
58 | + */ |
|
59 | + public static string $schemaTypeDescription = 'Indicates that a legislation is in force.'; |
|
60 | + |
|
61 | + |
|
62 | + /** |
|
63 | + * @inheritdoc |
|
64 | + */ |
|
65 | + public function getSchemaPropertyNames(): array |
|
66 | + { |
|
67 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
68 | + } |
|
69 | + |
|
70 | + |
|
71 | + /** |
|
72 | + * @inheritdoc |
|
73 | + */ |
|
74 | + public function getSchemaPropertyExpectedTypes(): array |
|
75 | + { |
|
76 | + return [ |
|
77 | + 'additionalType' => ['URL'], |
|
78 | + 'alternateName' => ['Text'], |
|
79 | + 'description' => ['Text'], |
|
80 | + 'disambiguatingDescription' => ['Text'], |
|
81 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
82 | + 'image' => ['URL', 'ImageObject'], |
|
83 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
84 | + 'name' => ['Text'], |
|
85 | + 'potentialAction' => ['Action'], |
|
86 | + 'sameAs' => ['URL'], |
|
87 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
88 | + 'supersededBy' => ['Class', 'Property', 'Enumeration'], |
|
89 | + 'url' => ['URL'] |
|
90 | + ]; |
|
91 | + } |
|
92 | + |
|
93 | + |
|
94 | + /** |
|
95 | + * @inheritdoc |
|
96 | + */ |
|
97 | + public function getSchemaPropertyDescriptions(): array |
|
98 | + { |
|
99 | + return [ |
|
100 | + '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.', |
|
101 | + 'alternateName' => 'An alias for the item.', |
|
102 | + 'description' => 'A description of the item.', |
|
103 | + '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.', |
|
104 | + '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. ', |
|
105 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
106 | + '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.', |
|
107 | + 'name' => 'The name of the item.', |
|
108 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
109 | + '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.', |
|
110 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
111 | + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', |
|
112 | + 'url' => 'URL of the item.' |
|
113 | + ]; |
|
114 | + } |
|
115 | + |
|
116 | + |
|
117 | + /** |
|
118 | + * @inheritdoc |
|
119 | + */ |
|
120 | + public function getGoogleRequiredSchema(): array |
|
121 | + { |
|
122 | + return ['description', 'name']; |
|
123 | + } |
|
124 | + |
|
125 | + |
|
126 | + /** |
|
127 | + * @inheritdoc |
|
128 | + */ |
|
129 | + public function getGoogleRecommendedSchema(): array |
|
130 | + { |
|
131 | + return ['image', 'url']; |
|
132 | + } |
|
133 | + |
|
134 | + |
|
135 | + /** |
|
136 | + * @inheritdoc |
|
137 | + */ |
|
138 | + public function defineRules(): array |
|
139 | + { |
|
140 | + $rules = parent::defineRules(); |
|
141 | + $rules = array_merge($rules, [ |
|
142 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
143 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
144 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
145 | + ]); |
|
146 | + |
|
147 | + return $rules; |
|
148 | + } |
|
149 | 149 | } |
@@ -23,126 +23,126 @@ |
||
23 | 23 | */ |
24 | 24 | class DisabilitySupport extends MetaJsonLd implements DisabilitySupportInterface, GovernmentBenefitsTypeInterface, EnumerationInterface, IntangibleInterface, ThingInterface |
25 | 25 | { |
26 | - use DisabilitySupportTrait; |
|
27 | - use GovernmentBenefitsTypeTrait; |
|
28 | - use EnumerationTrait; |
|
29 | - use IntangibleTrait; |
|
30 | - use ThingTrait; |
|
31 | - |
|
32 | - /** |
|
33 | - * The Schema.org Type Name |
|
34 | - * |
|
35 | - * @var string |
|
36 | - */ |
|
37 | - public static string $schemaTypeName = 'DisabilitySupport'; |
|
38 | - |
|
39 | - /** |
|
40 | - * The Schema.org Type Scope |
|
41 | - * |
|
42 | - * @var string |
|
43 | - */ |
|
44 | - public static string $schemaTypeScope = 'https://schema.org/DisabilitySupport'; |
|
45 | - |
|
46 | - /** |
|
47 | - * The Schema.org Type Extends |
|
48 | - * |
|
49 | - * @var string |
|
50 | - */ |
|
51 | - public static string $schemaTypeExtends = 'GovernmentBenefitsType'; |
|
52 | - |
|
53 | - /** |
|
54 | - * The Schema.org Type Description |
|
55 | - * |
|
56 | - * @var string |
|
57 | - */ |
|
58 | - public static string $schemaTypeDescription = 'DisabilitySupport: this is a benefit for disability support.'; |
|
59 | - |
|
60 | - |
|
61 | - /** |
|
62 | - * @inheritdoc |
|
63 | - */ |
|
64 | - public function getSchemaPropertyNames(): array |
|
65 | - { |
|
66 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * @inheritdoc |
|
72 | - */ |
|
73 | - public function getSchemaPropertyExpectedTypes(): array |
|
74 | - { |
|
75 | - return [ |
|
76 | - 'additionalType' => ['URL'], |
|
77 | - 'alternateName' => ['Text'], |
|
78 | - 'description' => ['Text'], |
|
79 | - 'disambiguatingDescription' => ['Text'], |
|
80 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
81 | - 'image' => ['URL', 'ImageObject'], |
|
82 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
83 | - 'name' => ['Text'], |
|
84 | - 'potentialAction' => ['Action'], |
|
85 | - 'sameAs' => ['URL'], |
|
86 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
87 | - 'supersededBy' => ['Class', 'Property', 'Enumeration'], |
|
88 | - 'url' => ['URL'] |
|
89 | - ]; |
|
90 | - } |
|
91 | - |
|
92 | - |
|
93 | - /** |
|
94 | - * @inheritdoc |
|
95 | - */ |
|
96 | - public function getSchemaPropertyDescriptions(): array |
|
97 | - { |
|
98 | - return [ |
|
99 | - '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.', |
|
100 | - 'alternateName' => 'An alias for the item.', |
|
101 | - 'description' => 'A description of the item.', |
|
102 | - '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.', |
|
103 | - '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. ', |
|
104 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
105 | - '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.', |
|
106 | - 'name' => 'The name of the item.', |
|
107 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
108 | - '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.', |
|
109 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
110 | - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', |
|
111 | - 'url' => 'URL of the item.' |
|
112 | - ]; |
|
113 | - } |
|
114 | - |
|
115 | - |
|
116 | - /** |
|
117 | - * @inheritdoc |
|
118 | - */ |
|
119 | - public function getGoogleRequiredSchema(): array |
|
120 | - { |
|
121 | - return ['description', 'name']; |
|
122 | - } |
|
123 | - |
|
124 | - |
|
125 | - /** |
|
126 | - * @inheritdoc |
|
127 | - */ |
|
128 | - public function getGoogleRecommendedSchema(): array |
|
129 | - { |
|
130 | - return ['image', 'url']; |
|
131 | - } |
|
132 | - |
|
133 | - |
|
134 | - /** |
|
135 | - * @inheritdoc |
|
136 | - */ |
|
137 | - public function defineRules(): array |
|
138 | - { |
|
139 | - $rules = parent::defineRules(); |
|
140 | - $rules = array_merge($rules, [ |
|
141 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
142 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
143 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
144 | - ]); |
|
145 | - |
|
146 | - return $rules; |
|
147 | - } |
|
26 | + use DisabilitySupportTrait; |
|
27 | + use GovernmentBenefitsTypeTrait; |
|
28 | + use EnumerationTrait; |
|
29 | + use IntangibleTrait; |
|
30 | + use ThingTrait; |
|
31 | + |
|
32 | + /** |
|
33 | + * The Schema.org Type Name |
|
34 | + * |
|
35 | + * @var string |
|
36 | + */ |
|
37 | + public static string $schemaTypeName = 'DisabilitySupport'; |
|
38 | + |
|
39 | + /** |
|
40 | + * The Schema.org Type Scope |
|
41 | + * |
|
42 | + * @var string |
|
43 | + */ |
|
44 | + public static string $schemaTypeScope = 'https://schema.org/DisabilitySupport'; |
|
45 | + |
|
46 | + /** |
|
47 | + * The Schema.org Type Extends |
|
48 | + * |
|
49 | + * @var string |
|
50 | + */ |
|
51 | + public static string $schemaTypeExtends = 'GovernmentBenefitsType'; |
|
52 | + |
|
53 | + /** |
|
54 | + * The Schema.org Type Description |
|
55 | + * |
|
56 | + * @var string |
|
57 | + */ |
|
58 | + public static string $schemaTypeDescription = 'DisabilitySupport: this is a benefit for disability support.'; |
|
59 | + |
|
60 | + |
|
61 | + /** |
|
62 | + * @inheritdoc |
|
63 | + */ |
|
64 | + public function getSchemaPropertyNames(): array |
|
65 | + { |
|
66 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * @inheritdoc |
|
72 | + */ |
|
73 | + public function getSchemaPropertyExpectedTypes(): array |
|
74 | + { |
|
75 | + return [ |
|
76 | + 'additionalType' => ['URL'], |
|
77 | + 'alternateName' => ['Text'], |
|
78 | + 'description' => ['Text'], |
|
79 | + 'disambiguatingDescription' => ['Text'], |
|
80 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
81 | + 'image' => ['URL', 'ImageObject'], |
|
82 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
83 | + 'name' => ['Text'], |
|
84 | + 'potentialAction' => ['Action'], |
|
85 | + 'sameAs' => ['URL'], |
|
86 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
87 | + 'supersededBy' => ['Class', 'Property', 'Enumeration'], |
|
88 | + 'url' => ['URL'] |
|
89 | + ]; |
|
90 | + } |
|
91 | + |
|
92 | + |
|
93 | + /** |
|
94 | + * @inheritdoc |
|
95 | + */ |
|
96 | + public function getSchemaPropertyDescriptions(): array |
|
97 | + { |
|
98 | + return [ |
|
99 | + '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.', |
|
100 | + 'alternateName' => 'An alias for the item.', |
|
101 | + 'description' => 'A description of the item.', |
|
102 | + '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.', |
|
103 | + '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. ', |
|
104 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
105 | + '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.', |
|
106 | + 'name' => 'The name of the item.', |
|
107 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
108 | + '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.', |
|
109 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
110 | + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', |
|
111 | + 'url' => 'URL of the item.' |
|
112 | + ]; |
|
113 | + } |
|
114 | + |
|
115 | + |
|
116 | + /** |
|
117 | + * @inheritdoc |
|
118 | + */ |
|
119 | + public function getGoogleRequiredSchema(): array |
|
120 | + { |
|
121 | + return ['description', 'name']; |
|
122 | + } |
|
123 | + |
|
124 | + |
|
125 | + /** |
|
126 | + * @inheritdoc |
|
127 | + */ |
|
128 | + public function getGoogleRecommendedSchema(): array |
|
129 | + { |
|
130 | + return ['image', 'url']; |
|
131 | + } |
|
132 | + |
|
133 | + |
|
134 | + /** |
|
135 | + * @inheritdoc |
|
136 | + */ |
|
137 | + public function defineRules(): array |
|
138 | + { |
|
139 | + $rules = parent::defineRules(); |
|
140 | + $rules = array_merge($rules, [ |
|
141 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
142 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
143 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
144 | + ]); |
|
145 | + |
|
146 | + return $rules; |
|
147 | + } |
|
148 | 148 | } |
@@ -25,155 +25,155 @@ |
||
25 | 25 | */ |
26 | 26 | class TaxiReservation extends MetaJsonLd implements TaxiReservationInterface, ReservationInterface, IntangibleInterface, ThingInterface |
27 | 27 | { |
28 | - use TaxiReservationTrait; |
|
29 | - use ReservationTrait; |
|
30 | - use IntangibleTrait; |
|
31 | - use ThingTrait; |
|
32 | - |
|
33 | - /** |
|
34 | - * The Schema.org Type Name |
|
35 | - * |
|
36 | - * @var string |
|
37 | - */ |
|
38 | - public static string $schemaTypeName = 'TaxiReservation'; |
|
39 | - |
|
40 | - /** |
|
41 | - * The Schema.org Type Scope |
|
42 | - * |
|
43 | - * @var string |
|
44 | - */ |
|
45 | - public static string $schemaTypeScope = 'https://schema.org/TaxiReservation'; |
|
46 | - |
|
47 | - /** |
|
48 | - * The Schema.org Type Extends |
|
49 | - * |
|
50 | - * @var string |
|
51 | - */ |
|
52 | - public static string $schemaTypeExtends = 'Reservation'; |
|
53 | - |
|
54 | - /** |
|
55 | - * The Schema.org Type Description |
|
56 | - * |
|
57 | - * @var string |
|
58 | - */ |
|
59 | - public static string $schemaTypeDescription = 'A reservation for a taxi.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, use [[Offer]].'; |
|
60 | - |
|
61 | - |
|
62 | - /** |
|
63 | - * @inheritdoc |
|
64 | - */ |
|
65 | - public function getSchemaPropertyNames(): array |
|
66 | - { |
|
67 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
68 | - } |
|
69 | - |
|
70 | - |
|
71 | - /** |
|
72 | - * @inheritdoc |
|
73 | - */ |
|
74 | - public function getSchemaPropertyExpectedTypes(): array |
|
75 | - { |
|
76 | - return [ |
|
77 | - 'additionalType' => ['URL'], |
|
78 | - 'alternateName' => ['Text'], |
|
79 | - 'bookingAgent' => ['Organization', 'Person'], |
|
80 | - 'bookingTime' => ['DateTime'], |
|
81 | - 'broker' => ['Person', 'Organization'], |
|
82 | - 'description' => ['Text'], |
|
83 | - 'disambiguatingDescription' => ['Text'], |
|
84 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
85 | - 'image' => ['URL', 'ImageObject'], |
|
86 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
87 | - 'modifiedTime' => ['DateTime'], |
|
88 | - 'name' => ['Text'], |
|
89 | - 'partySize' => ['QuantitativeValue', 'Integer'], |
|
90 | - 'pickupLocation' => ['Place'], |
|
91 | - 'pickupTime' => ['DateTime'], |
|
92 | - 'potentialAction' => ['Action'], |
|
93 | - 'priceCurrency' => ['Text'], |
|
94 | - 'programMembershipUsed' => ['ProgramMembership'], |
|
95 | - 'provider' => ['Organization', 'Person'], |
|
96 | - 'reservationFor' => ['Thing'], |
|
97 | - 'reservationId' => ['Text'], |
|
98 | - 'reservationStatus' => ['ReservationStatusType'], |
|
99 | - 'reservedTicket' => ['Ticket'], |
|
100 | - 'sameAs' => ['URL'], |
|
101 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
102 | - 'totalPrice' => ['Number', 'PriceSpecification', 'Text'], |
|
103 | - 'underName' => ['Organization', 'Person'], |
|
104 | - 'url' => ['URL'] |
|
105 | - ]; |
|
106 | - } |
|
107 | - |
|
108 | - |
|
109 | - /** |
|
110 | - * @inheritdoc |
|
111 | - */ |
|
112 | - public function getSchemaPropertyDescriptions(): array |
|
113 | - { |
|
114 | - return [ |
|
115 | - '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.', |
|
116 | - 'alternateName' => 'An alias for the item.', |
|
117 | - 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', |
|
118 | - 'bookingTime' => 'The date and time the reservation was booked.', |
|
119 | - 'broker' => 'An entity that arranges for an exchange between a buyer and a seller. In most cases a broker never acquires or releases ownership of a product or service involved in an exchange. If it is not clear whether an entity is a broker, seller, or buyer, the latter two terms are preferred.', |
|
120 | - 'description' => 'A description of the item.', |
|
121 | - '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.', |
|
122 | - '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. ', |
|
123 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
124 | - '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.', |
|
125 | - 'modifiedTime' => 'The date and time the reservation was modified.', |
|
126 | - 'name' => 'The name of the item.', |
|
127 | - 'partySize' => 'Number of people the reservation should accommodate.', |
|
128 | - 'pickupLocation' => 'Where a taxi will pick up a passenger or a rental car can be picked up.', |
|
129 | - 'pickupTime' => 'When a taxi will pick up a passenger or a rental car can be picked up.', |
|
130 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
131 | - 'priceCurrency' => 'The currency of the price, or a price component when attached to [[PriceSpecification]] and its subtypes. Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".', |
|
132 | - 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', |
|
133 | - 'provider' => 'The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.', |
|
134 | - 'reservationFor' => 'The thing -- flight, event, restaurant, etc. being reserved.', |
|
135 | - 'reservationId' => 'A unique identifier for the reservation.', |
|
136 | - 'reservationStatus' => 'The current status of the reservation.', |
|
137 | - 'reservedTicket' => 'A ticket associated with the reservation.', |
|
138 | - '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.', |
|
139 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
140 | - 'totalPrice' => 'The total price for the reservation or ticket, including applicable taxes, shipping, etc. Usage guidelines: * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', |
|
141 | - 'underName' => 'The person or organization the reservation or ticket is for.', |
|
142 | - 'url' => 'URL of the item.' |
|
143 | - ]; |
|
144 | - } |
|
145 | - |
|
146 | - |
|
147 | - /** |
|
148 | - * @inheritdoc |
|
149 | - */ |
|
150 | - public function getGoogleRequiredSchema(): array |
|
151 | - { |
|
152 | - return ['description', 'name']; |
|
153 | - } |
|
154 | - |
|
155 | - |
|
156 | - /** |
|
157 | - * @inheritdoc |
|
158 | - */ |
|
159 | - public function getGoogleRecommendedSchema(): array |
|
160 | - { |
|
161 | - return ['image', 'url']; |
|
162 | - } |
|
163 | - |
|
164 | - |
|
165 | - /** |
|
166 | - * @inheritdoc |
|
167 | - */ |
|
168 | - public function defineRules(): array |
|
169 | - { |
|
170 | - $rules = parent::defineRules(); |
|
171 | - $rules = array_merge($rules, [ |
|
172 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
173 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
174 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
175 | - ]); |
|
176 | - |
|
177 | - return $rules; |
|
178 | - } |
|
28 | + use TaxiReservationTrait; |
|
29 | + use ReservationTrait; |
|
30 | + use IntangibleTrait; |
|
31 | + use ThingTrait; |
|
32 | + |
|
33 | + /** |
|
34 | + * The Schema.org Type Name |
|
35 | + * |
|
36 | + * @var string |
|
37 | + */ |
|
38 | + public static string $schemaTypeName = 'TaxiReservation'; |
|
39 | + |
|
40 | + /** |
|
41 | + * The Schema.org Type Scope |
|
42 | + * |
|
43 | + * @var string |
|
44 | + */ |
|
45 | + public static string $schemaTypeScope = 'https://schema.org/TaxiReservation'; |
|
46 | + |
|
47 | + /** |
|
48 | + * The Schema.org Type Extends |
|
49 | + * |
|
50 | + * @var string |
|
51 | + */ |
|
52 | + public static string $schemaTypeExtends = 'Reservation'; |
|
53 | + |
|
54 | + /** |
|
55 | + * The Schema.org Type Description |
|
56 | + * |
|
57 | + * @var string |
|
58 | + */ |
|
59 | + public static string $schemaTypeDescription = 'A reservation for a taxi.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, use [[Offer]].'; |
|
60 | + |
|
61 | + |
|
62 | + /** |
|
63 | + * @inheritdoc |
|
64 | + */ |
|
65 | + public function getSchemaPropertyNames(): array |
|
66 | + { |
|
67 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
68 | + } |
|
69 | + |
|
70 | + |
|
71 | + /** |
|
72 | + * @inheritdoc |
|
73 | + */ |
|
74 | + public function getSchemaPropertyExpectedTypes(): array |
|
75 | + { |
|
76 | + return [ |
|
77 | + 'additionalType' => ['URL'], |
|
78 | + 'alternateName' => ['Text'], |
|
79 | + 'bookingAgent' => ['Organization', 'Person'], |
|
80 | + 'bookingTime' => ['DateTime'], |
|
81 | + 'broker' => ['Person', 'Organization'], |
|
82 | + 'description' => ['Text'], |
|
83 | + 'disambiguatingDescription' => ['Text'], |
|
84 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
85 | + 'image' => ['URL', 'ImageObject'], |
|
86 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
87 | + 'modifiedTime' => ['DateTime'], |
|
88 | + 'name' => ['Text'], |
|
89 | + 'partySize' => ['QuantitativeValue', 'Integer'], |
|
90 | + 'pickupLocation' => ['Place'], |
|
91 | + 'pickupTime' => ['DateTime'], |
|
92 | + 'potentialAction' => ['Action'], |
|
93 | + 'priceCurrency' => ['Text'], |
|
94 | + 'programMembershipUsed' => ['ProgramMembership'], |
|
95 | + 'provider' => ['Organization', 'Person'], |
|
96 | + 'reservationFor' => ['Thing'], |
|
97 | + 'reservationId' => ['Text'], |
|
98 | + 'reservationStatus' => ['ReservationStatusType'], |
|
99 | + 'reservedTicket' => ['Ticket'], |
|
100 | + 'sameAs' => ['URL'], |
|
101 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
102 | + 'totalPrice' => ['Number', 'PriceSpecification', 'Text'], |
|
103 | + 'underName' => ['Organization', 'Person'], |
|
104 | + 'url' => ['URL'] |
|
105 | + ]; |
|
106 | + } |
|
107 | + |
|
108 | + |
|
109 | + /** |
|
110 | + * @inheritdoc |
|
111 | + */ |
|
112 | + public function getSchemaPropertyDescriptions(): array |
|
113 | + { |
|
114 | + return [ |
|
115 | + '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.', |
|
116 | + 'alternateName' => 'An alias for the item.', |
|
117 | + 'bookingAgent' => '\'bookingAgent\' is an out-dated term indicating a \'broker\' that serves as a booking agent.', |
|
118 | + 'bookingTime' => 'The date and time the reservation was booked.', |
|
119 | + 'broker' => 'An entity that arranges for an exchange between a buyer and a seller. In most cases a broker never acquires or releases ownership of a product or service involved in an exchange. If it is not clear whether an entity is a broker, seller, or buyer, the latter two terms are preferred.', |
|
120 | + 'description' => 'A description of the item.', |
|
121 | + '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.', |
|
122 | + '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. ', |
|
123 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
124 | + '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.', |
|
125 | + 'modifiedTime' => 'The date and time the reservation was modified.', |
|
126 | + 'name' => 'The name of the item.', |
|
127 | + 'partySize' => 'Number of people the reservation should accommodate.', |
|
128 | + 'pickupLocation' => 'Where a taxi will pick up a passenger or a rental car can be picked up.', |
|
129 | + 'pickupTime' => 'When a taxi will pick up a passenger or a rental car can be picked up.', |
|
130 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
131 | + 'priceCurrency' => 'The currency of the price, or a price component when attached to [[PriceSpecification]] and its subtypes. Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".', |
|
132 | + 'programMembershipUsed' => 'Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation.', |
|
133 | + 'provider' => 'The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.', |
|
134 | + 'reservationFor' => 'The thing -- flight, event, restaurant, etc. being reserved.', |
|
135 | + 'reservationId' => 'A unique identifier for the reservation.', |
|
136 | + 'reservationStatus' => 'The current status of the reservation.', |
|
137 | + 'reservedTicket' => 'A ticket associated with the reservation.', |
|
138 | + '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.', |
|
139 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
140 | + 'totalPrice' => 'The total price for the reservation or ticket, including applicable taxes, shipping, etc. Usage guidelines: * Use values from 0123456789 (Unicode \'DIGIT ZERO\' (U+0030) to \'DIGIT NINE\' (U+0039)) rather than superficially similar Unicode symbols. * Use \'.\' (Unicode \'FULL STOP\' (U+002E)) rather than \',\' to indicate a decimal point. Avoid using these symbols as a readability separator.', |
|
141 | + 'underName' => 'The person or organization the reservation or ticket is for.', |
|
142 | + 'url' => 'URL of the item.' |
|
143 | + ]; |
|
144 | + } |
|
145 | + |
|
146 | + |
|
147 | + /** |
|
148 | + * @inheritdoc |
|
149 | + */ |
|
150 | + public function getGoogleRequiredSchema(): array |
|
151 | + { |
|
152 | + return ['description', 'name']; |
|
153 | + } |
|
154 | + |
|
155 | + |
|
156 | + /** |
|
157 | + * @inheritdoc |
|
158 | + */ |
|
159 | + public function getGoogleRecommendedSchema(): array |
|
160 | + { |
|
161 | + return ['image', 'url']; |
|
162 | + } |
|
163 | + |
|
164 | + |
|
165 | + /** |
|
166 | + * @inheritdoc |
|
167 | + */ |
|
168 | + public function defineRules(): array |
|
169 | + { |
|
170 | + $rules = parent::defineRules(); |
|
171 | + $rules = array_merge($rules, [ |
|
172 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
173 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
174 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
175 | + ]); |
|
176 | + |
|
177 | + return $rules; |
|
178 | + } |
|
179 | 179 | } |
@@ -25,215 +25,215 @@ |
||
25 | 25 | */ |
26 | 26 | class UserComments extends MetaJsonLd implements UserCommentsInterface, UserInteractionInterface, EventInterface, ThingInterface |
27 | 27 | { |
28 | - use UserCommentsTrait; |
|
29 | - use UserInteractionTrait; |
|
30 | - use EventTrait; |
|
31 | - use ThingTrait; |
|
32 | - |
|
33 | - /** |
|
34 | - * The Schema.org Type Name |
|
35 | - * |
|
36 | - * @var string |
|
37 | - */ |
|
38 | - public static string $schemaTypeName = 'UserComments'; |
|
39 | - |
|
40 | - /** |
|
41 | - * The Schema.org Type Scope |
|
42 | - * |
|
43 | - * @var string |
|
44 | - */ |
|
45 | - public static string $schemaTypeScope = 'https://schema.org/UserComments'; |
|
46 | - |
|
47 | - /** |
|
48 | - * The Schema.org Type Extends |
|
49 | - * |
|
50 | - * @var string |
|
51 | - */ |
|
52 | - public static string $schemaTypeExtends = 'UserInteraction'; |
|
53 | - |
|
54 | - /** |
|
55 | - * The Schema.org Type Description |
|
56 | - * |
|
57 | - * @var string |
|
58 | - */ |
|
59 | - public static string $schemaTypeDescription = 'UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]].'; |
|
60 | - |
|
61 | - |
|
62 | - /** |
|
63 | - * @inheritdoc |
|
64 | - */ |
|
65 | - public function getSchemaPropertyNames(): array |
|
66 | - { |
|
67 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
68 | - } |
|
69 | - |
|
70 | - |
|
71 | - /** |
|
72 | - * @inheritdoc |
|
73 | - */ |
|
74 | - public function getSchemaPropertyExpectedTypes(): array |
|
75 | - { |
|
76 | - return [ |
|
77 | - 'about' => ['Thing'], |
|
78 | - 'actor' => ['Person'], |
|
79 | - 'additionalType' => ['URL'], |
|
80 | - 'aggregateRating' => ['AggregateRating'], |
|
81 | - 'alternateName' => ['Text'], |
|
82 | - 'attendee' => ['Organization', 'Person'], |
|
83 | - 'attendees' => ['Organization', 'Person'], |
|
84 | - 'audience' => ['Audience'], |
|
85 | - 'commentText' => ['Text'], |
|
86 | - 'commentTime' => ['DateTime', 'Date'], |
|
87 | - 'composer' => ['Organization', 'Person'], |
|
88 | - 'contributor' => ['Organization', 'Person'], |
|
89 | - 'creator' => ['Person', 'Organization'], |
|
90 | - 'description' => ['Text'], |
|
91 | - 'director' => ['Person'], |
|
92 | - 'disambiguatingDescription' => ['Text'], |
|
93 | - 'discusses' => ['CreativeWork'], |
|
94 | - 'doorTime' => ['Time', 'DateTime'], |
|
95 | - 'duration' => ['Duration'], |
|
96 | - 'endDate' => ['DateTime', 'Date'], |
|
97 | - 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], |
|
98 | - 'eventSchedule' => ['Schedule'], |
|
99 | - 'eventStatus' => ['EventStatusType'], |
|
100 | - 'funder' => ['Organization', 'Person'], |
|
101 | - 'funding' => ['Grant'], |
|
102 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
103 | - 'image' => ['URL', 'ImageObject'], |
|
104 | - 'inLanguage' => ['Text', 'Language'], |
|
105 | - 'isAccessibleForFree' => ['Boolean'], |
|
106 | - 'keywords' => ['URL', 'DefinedTerm', 'Text'], |
|
107 | - 'location' => ['Place', 'Text', 'VirtualLocation', 'PostalAddress'], |
|
108 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
109 | - 'maximumAttendeeCapacity' => ['Integer'], |
|
110 | - 'maximumPhysicalAttendeeCapacity' => ['Integer'], |
|
111 | - 'maximumVirtualAttendeeCapacity' => ['Integer'], |
|
112 | - 'name' => ['Text'], |
|
113 | - 'offers' => ['Demand', 'Offer'], |
|
114 | - 'organizer' => ['Organization', 'Person'], |
|
115 | - 'performer' => ['Person', 'Organization'], |
|
116 | - 'performers' => ['Person', 'Organization'], |
|
117 | - 'potentialAction' => ['Action'], |
|
118 | - 'previousStartDate' => ['Date'], |
|
119 | - 'recordedIn' => ['CreativeWork'], |
|
120 | - 'remainingAttendeeCapacity' => ['Integer'], |
|
121 | - 'replyToUrl' => ['URL'], |
|
122 | - 'review' => ['Review'], |
|
123 | - 'sameAs' => ['URL'], |
|
124 | - 'sponsor' => ['Organization', 'Person'], |
|
125 | - 'startDate' => ['DateTime', 'Date'], |
|
126 | - 'subEvent' => ['Event'], |
|
127 | - 'subEvents' => ['Event'], |
|
128 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
129 | - 'superEvent' => ['Event'], |
|
130 | - 'translator' => ['Organization', 'Person'], |
|
131 | - 'typicalAgeRange' => ['Text'], |
|
132 | - 'url' => ['URL'], |
|
133 | - 'workFeatured' => ['CreativeWork'], |
|
134 | - 'workPerformed' => ['CreativeWork'] |
|
135 | - ]; |
|
136 | - } |
|
137 | - |
|
138 | - |
|
139 | - /** |
|
140 | - * @inheritdoc |
|
141 | - */ |
|
142 | - public function getSchemaPropertyDescriptions(): array |
|
143 | - { |
|
144 | - return [ |
|
145 | - 'about' => 'The subject matter of the content.', |
|
146 | - 'actor' => 'An actor, e.g. in TV, radio, movie, video games etc., or in an event. Actors can be associated with individual items or with a series, episode, clip.', |
|
147 | - '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.', |
|
148 | - 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', |
|
149 | - 'alternateName' => 'An alias for the item.', |
|
150 | - 'attendee' => 'A person or organization attending the event.', |
|
151 | - 'attendees' => 'A person attending the event.', |
|
152 | - 'audience' => 'An intended audience, i.e. a group for whom something was created.', |
|
153 | - 'commentText' => 'The text of the UserComment.', |
|
154 | - 'commentTime' => 'The time at which the UserComment was made.', |
|
155 | - 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', |
|
156 | - 'contributor' => 'A secondary contributor to the CreativeWork or Event.', |
|
157 | - 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', |
|
158 | - 'description' => 'A description of the item.', |
|
159 | - 'director' => 'A director of e.g. TV, radio, movie, video gaming etc. content, or of an event. Directors can be associated with individual items or with a series, episode, clip.', |
|
160 | - '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.', |
|
161 | - 'discusses' => 'Specifies the CreativeWork associated with the UserComment.', |
|
162 | - 'doorTime' => 'The time admission will commence.', |
|
163 | - 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', |
|
164 | - 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', |
|
165 | - 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', |
|
166 | - 'eventSchedule' => 'Associates an [[Event]] with a [[Schedule]]. There are circumstances where it is preferable to share a schedule for a series of repeating events rather than data on the individual events themselves. For example, a website or application might prefer to publish a schedule for a weekly gym class rather than provide data on every event. A schedule could be processed by applications to add forthcoming events to a calendar. An [[Event]] that is associated with a [[Schedule]] using this property should not have [[startDate]] or [[endDate]] properties. These are instead defined within the associated [[Schedule]], this avoids any ambiguity for clients using the data. The property might have repeated values to specify different schedules, e.g. for different months or seasons.', |
|
167 | - 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', |
|
168 | - 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', |
|
169 | - 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', |
|
170 | - '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. ', |
|
171 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
172 | - 'inLanguage' => 'The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].', |
|
173 | - 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', |
|
174 | - '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.', |
|
175 | - 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', |
|
176 | - '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.', |
|
177 | - 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', |
|
178 | - 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', |
|
179 | - 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', |
|
180 | - 'name' => 'The name of the item.', |
|
181 | - '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. ', |
|
182 | - 'organizer' => 'An organizer of an Event.', |
|
183 | - 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', |
|
184 | - 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', |
|
185 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
186 | - 'previousStartDate' => 'Used in conjunction with eventStatus for rescheduled or cancelled events. This property contains the previously scheduled start date. For rescheduled events, the startDate property should be used for the newly scheduled start date. In the (rare) case of an event that has been postponed and rescheduled multiple times, this field may be repeated.', |
|
187 | - 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', |
|
188 | - 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', |
|
189 | - 'replyToUrl' => 'The URL at which a reply may be posted to the specified UserComment.', |
|
190 | - 'review' => 'A review of the item.', |
|
191 | - '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.', |
|
192 | - 'sponsor' => 'A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.', |
|
193 | - 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', |
|
194 | - 'subEvent' => 'An Event that is part of this event. For example, a conference event includes many presentations, each of which is a subEvent of the conference.', |
|
195 | - 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', |
|
196 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
197 | - 'superEvent' => 'An event that this event is a part of. For example, a collection of individual music performances might each have a music festival as their superEvent.', |
|
198 | - 'translator' => 'Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.', |
|
199 | - 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', |
|
200 | - 'url' => 'URL of the item.', |
|
201 | - 'workFeatured' => 'A work featured in some event, e.g. exhibited in an ExhibitionEvent. Specific subproperties are available for workPerformed (e.g. a play), or a workPresented (a Movie at a ScreeningEvent).', |
|
202 | - 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' |
|
203 | - ]; |
|
204 | - } |
|
205 | - |
|
206 | - |
|
207 | - /** |
|
208 | - * @inheritdoc |
|
209 | - */ |
|
210 | - public function getGoogleRequiredSchema(): array |
|
211 | - { |
|
212 | - return ['description', 'name']; |
|
213 | - } |
|
214 | - |
|
215 | - |
|
216 | - /** |
|
217 | - * @inheritdoc |
|
218 | - */ |
|
219 | - public function getGoogleRecommendedSchema(): array |
|
220 | - { |
|
221 | - return ['image', 'url']; |
|
222 | - } |
|
223 | - |
|
224 | - |
|
225 | - /** |
|
226 | - * @inheritdoc |
|
227 | - */ |
|
228 | - public function defineRules(): array |
|
229 | - { |
|
230 | - $rules = parent::defineRules(); |
|
231 | - $rules = array_merge($rules, [ |
|
232 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
233 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
234 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
235 | - ]); |
|
236 | - |
|
237 | - return $rules; |
|
238 | - } |
|
28 | + use UserCommentsTrait; |
|
29 | + use UserInteractionTrait; |
|
30 | + use EventTrait; |
|
31 | + use ThingTrait; |
|
32 | + |
|
33 | + /** |
|
34 | + * The Schema.org Type Name |
|
35 | + * |
|
36 | + * @var string |
|
37 | + */ |
|
38 | + public static string $schemaTypeName = 'UserComments'; |
|
39 | + |
|
40 | + /** |
|
41 | + * The Schema.org Type Scope |
|
42 | + * |
|
43 | + * @var string |
|
44 | + */ |
|
45 | + public static string $schemaTypeScope = 'https://schema.org/UserComments'; |
|
46 | + |
|
47 | + /** |
|
48 | + * The Schema.org Type Extends |
|
49 | + * |
|
50 | + * @var string |
|
51 | + */ |
|
52 | + public static string $schemaTypeExtends = 'UserInteraction'; |
|
53 | + |
|
54 | + /** |
|
55 | + * The Schema.org Type Description |
|
56 | + * |
|
57 | + * @var string |
|
58 | + */ |
|
59 | + public static string $schemaTypeDescription = 'UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]].'; |
|
60 | + |
|
61 | + |
|
62 | + /** |
|
63 | + * @inheritdoc |
|
64 | + */ |
|
65 | + public function getSchemaPropertyNames(): array |
|
66 | + { |
|
67 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
68 | + } |
|
69 | + |
|
70 | + |
|
71 | + /** |
|
72 | + * @inheritdoc |
|
73 | + */ |
|
74 | + public function getSchemaPropertyExpectedTypes(): array |
|
75 | + { |
|
76 | + return [ |
|
77 | + 'about' => ['Thing'], |
|
78 | + 'actor' => ['Person'], |
|
79 | + 'additionalType' => ['URL'], |
|
80 | + 'aggregateRating' => ['AggregateRating'], |
|
81 | + 'alternateName' => ['Text'], |
|
82 | + 'attendee' => ['Organization', 'Person'], |
|
83 | + 'attendees' => ['Organization', 'Person'], |
|
84 | + 'audience' => ['Audience'], |
|
85 | + 'commentText' => ['Text'], |
|
86 | + 'commentTime' => ['DateTime', 'Date'], |
|
87 | + 'composer' => ['Organization', 'Person'], |
|
88 | + 'contributor' => ['Organization', 'Person'], |
|
89 | + 'creator' => ['Person', 'Organization'], |
|
90 | + 'description' => ['Text'], |
|
91 | + 'director' => ['Person'], |
|
92 | + 'disambiguatingDescription' => ['Text'], |
|
93 | + 'discusses' => ['CreativeWork'], |
|
94 | + 'doorTime' => ['Time', 'DateTime'], |
|
95 | + 'duration' => ['Duration'], |
|
96 | + 'endDate' => ['DateTime', 'Date'], |
|
97 | + 'eventAttendanceMode' => ['EventAttendanceModeEnumeration'], |
|
98 | + 'eventSchedule' => ['Schedule'], |
|
99 | + 'eventStatus' => ['EventStatusType'], |
|
100 | + 'funder' => ['Organization', 'Person'], |
|
101 | + 'funding' => ['Grant'], |
|
102 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
103 | + 'image' => ['URL', 'ImageObject'], |
|
104 | + 'inLanguage' => ['Text', 'Language'], |
|
105 | + 'isAccessibleForFree' => ['Boolean'], |
|
106 | + 'keywords' => ['URL', 'DefinedTerm', 'Text'], |
|
107 | + 'location' => ['Place', 'Text', 'VirtualLocation', 'PostalAddress'], |
|
108 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
109 | + 'maximumAttendeeCapacity' => ['Integer'], |
|
110 | + 'maximumPhysicalAttendeeCapacity' => ['Integer'], |
|
111 | + 'maximumVirtualAttendeeCapacity' => ['Integer'], |
|
112 | + 'name' => ['Text'], |
|
113 | + 'offers' => ['Demand', 'Offer'], |
|
114 | + 'organizer' => ['Organization', 'Person'], |
|
115 | + 'performer' => ['Person', 'Organization'], |
|
116 | + 'performers' => ['Person', 'Organization'], |
|
117 | + 'potentialAction' => ['Action'], |
|
118 | + 'previousStartDate' => ['Date'], |
|
119 | + 'recordedIn' => ['CreativeWork'], |
|
120 | + 'remainingAttendeeCapacity' => ['Integer'], |
|
121 | + 'replyToUrl' => ['URL'], |
|
122 | + 'review' => ['Review'], |
|
123 | + 'sameAs' => ['URL'], |
|
124 | + 'sponsor' => ['Organization', 'Person'], |
|
125 | + 'startDate' => ['DateTime', 'Date'], |
|
126 | + 'subEvent' => ['Event'], |
|
127 | + 'subEvents' => ['Event'], |
|
128 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
129 | + 'superEvent' => ['Event'], |
|
130 | + 'translator' => ['Organization', 'Person'], |
|
131 | + 'typicalAgeRange' => ['Text'], |
|
132 | + 'url' => ['URL'], |
|
133 | + 'workFeatured' => ['CreativeWork'], |
|
134 | + 'workPerformed' => ['CreativeWork'] |
|
135 | + ]; |
|
136 | + } |
|
137 | + |
|
138 | + |
|
139 | + /** |
|
140 | + * @inheritdoc |
|
141 | + */ |
|
142 | + public function getSchemaPropertyDescriptions(): array |
|
143 | + { |
|
144 | + return [ |
|
145 | + 'about' => 'The subject matter of the content.', |
|
146 | + 'actor' => 'An actor, e.g. in TV, radio, movie, video games etc., or in an event. Actors can be associated with individual items or with a series, episode, clip.', |
|
147 | + '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.', |
|
148 | + 'aggregateRating' => 'The overall rating, based on a collection of reviews or ratings, of the item.', |
|
149 | + 'alternateName' => 'An alias for the item.', |
|
150 | + 'attendee' => 'A person or organization attending the event.', |
|
151 | + 'attendees' => 'A person attending the event.', |
|
152 | + 'audience' => 'An intended audience, i.e. a group for whom something was created.', |
|
153 | + 'commentText' => 'The text of the UserComment.', |
|
154 | + 'commentTime' => 'The time at which the UserComment was made.', |
|
155 | + 'composer' => 'The person or organization who wrote a composition, or who is the composer of a work performed at some event.', |
|
156 | + 'contributor' => 'A secondary contributor to the CreativeWork or Event.', |
|
157 | + 'creator' => 'The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.', |
|
158 | + 'description' => 'A description of the item.', |
|
159 | + 'director' => 'A director of e.g. TV, radio, movie, video gaming etc. content, or of an event. Directors can be associated with individual items or with a series, episode, clip.', |
|
160 | + '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.', |
|
161 | + 'discusses' => 'Specifies the CreativeWork associated with the UserComment.', |
|
162 | + 'doorTime' => 'The time admission will commence.', |
|
163 | + 'duration' => 'The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).', |
|
164 | + 'endDate' => 'The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', |
|
165 | + 'eventAttendanceMode' => 'The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix.', |
|
166 | + 'eventSchedule' => 'Associates an [[Event]] with a [[Schedule]]. There are circumstances where it is preferable to share a schedule for a series of repeating events rather than data on the individual events themselves. For example, a website or application might prefer to publish a schedule for a weekly gym class rather than provide data on every event. A schedule could be processed by applications to add forthcoming events to a calendar. An [[Event]] that is associated with a [[Schedule]] using this property should not have [[startDate]] or [[endDate]] properties. These are instead defined within the associated [[Schedule]], this avoids any ambiguity for clients using the data. The property might have repeated values to specify different schedules, e.g. for different months or seasons.', |
|
167 | + 'eventStatus' => 'An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled.', |
|
168 | + 'funder' => 'A person or organization that supports (sponsors) something through some kind of financial contribution.', |
|
169 | + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', |
|
170 | + '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. ', |
|
171 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
172 | + 'inLanguage' => 'The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].', |
|
173 | + 'isAccessibleForFree' => 'A flag to signal that the item, event, or place is accessible for free.', |
|
174 | + '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.', |
|
175 | + 'location' => 'The location of, for example, where an event is happening, where an organization is located, or where an action takes place.', |
|
176 | + '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.', |
|
177 | + 'maximumAttendeeCapacity' => 'The total number of individuals that may attend an event or venue.', |
|
178 | + 'maximumPhysicalAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). ', |
|
179 | + 'maximumVirtualAttendeeCapacity' => 'The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). ', |
|
180 | + 'name' => 'The name of the item.', |
|
181 | + '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. ', |
|
182 | + 'organizer' => 'An organizer of an Event.', |
|
183 | + 'performer' => 'A performer at the event—for example, a presenter, musician, musical group or actor.', |
|
184 | + 'performers' => 'The main performer or performers of the event—for example, a presenter, musician, or actor.', |
|
185 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
186 | + 'previousStartDate' => 'Used in conjunction with eventStatus for rescheduled or cancelled events. This property contains the previously scheduled start date. For rescheduled events, the startDate property should be used for the newly scheduled start date. In the (rare) case of an event that has been postponed and rescheduled multiple times, this field may be repeated.', |
|
187 | + 'recordedIn' => 'The CreativeWork that captured all or part of this Event.', |
|
188 | + 'remainingAttendeeCapacity' => 'The number of attendee places for an event that remain unallocated.', |
|
189 | + 'replyToUrl' => 'The URL at which a reply may be posted to the specified UserComment.', |
|
190 | + 'review' => 'A review of the item.', |
|
191 | + '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.', |
|
192 | + 'sponsor' => 'A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.', |
|
193 | + 'startDate' => 'The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).', |
|
194 | + 'subEvent' => 'An Event that is part of this event. For example, a conference event includes many presentations, each of which is a subEvent of the conference.', |
|
195 | + 'subEvents' => 'Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference.', |
|
196 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
197 | + 'superEvent' => 'An event that this event is a part of. For example, a collection of individual music performances might each have a music festival as their superEvent.', |
|
198 | + 'translator' => 'Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.', |
|
199 | + 'typicalAgeRange' => 'The typical expected age range, e.g. \'7-9\', \'11-\'.', |
|
200 | + 'url' => 'URL of the item.', |
|
201 | + 'workFeatured' => 'A work featured in some event, e.g. exhibited in an ExhibitionEvent. Specific subproperties are available for workPerformed (e.g. a play), or a workPresented (a Movie at a ScreeningEvent).', |
|
202 | + 'workPerformed' => 'A work performed in some event, for example a play performed in a TheaterEvent.' |
|
203 | + ]; |
|
204 | + } |
|
205 | + |
|
206 | + |
|
207 | + /** |
|
208 | + * @inheritdoc |
|
209 | + */ |
|
210 | + public function getGoogleRequiredSchema(): array |
|
211 | + { |
|
212 | + return ['description', 'name']; |
|
213 | + } |
|
214 | + |
|
215 | + |
|
216 | + /** |
|
217 | + * @inheritdoc |
|
218 | + */ |
|
219 | + public function getGoogleRecommendedSchema(): array |
|
220 | + { |
|
221 | + return ['image', 'url']; |
|
222 | + } |
|
223 | + |
|
224 | + |
|
225 | + /** |
|
226 | + * @inheritdoc |
|
227 | + */ |
|
228 | + public function defineRules(): array |
|
229 | + { |
|
230 | + $rules = parent::defineRules(); |
|
231 | + $rules = array_merge($rules, [ |
|
232 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
233 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
234 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
235 | + ]); |
|
236 | + |
|
237 | + return $rules; |
|
238 | + } |
|
239 | 239 | } |
@@ -24,125 +24,125 @@ |
||
24 | 24 | */ |
25 | 25 | class GameAvailabilityEnumeration extends MetaJsonLd implements GameAvailabilityEnumerationInterface, EnumerationInterface, IntangibleInterface, ThingInterface |
26 | 26 | { |
27 | - use GameAvailabilityEnumerationTrait; |
|
28 | - use EnumerationTrait; |
|
29 | - use IntangibleTrait; |
|
30 | - use ThingTrait; |
|
31 | - |
|
32 | - /** |
|
33 | - * The Schema.org Type Name |
|
34 | - * |
|
35 | - * @var string |
|
36 | - */ |
|
37 | - public static string $schemaTypeName = 'GameAvailabilityEnumeration'; |
|
38 | - |
|
39 | - /** |
|
40 | - * The Schema.org Type Scope |
|
41 | - * |
|
42 | - * @var string |
|
43 | - */ |
|
44 | - public static string $schemaTypeScope = 'https://schema.org/GameAvailabilityEnumeration'; |
|
45 | - |
|
46 | - /** |
|
47 | - * The Schema.org Type Extends |
|
48 | - * |
|
49 | - * @var string |
|
50 | - */ |
|
51 | - public static string $schemaTypeExtends = 'Enumeration'; |
|
52 | - |
|
53 | - /** |
|
54 | - * The Schema.org Type Description |
|
55 | - * |
|
56 | - * @var string |
|
57 | - */ |
|
58 | - public static string $schemaTypeDescription = 'For a [[VideoGame]], such as used with a [[PlayGameAction]], an enumeration of the kind of game availability offered. '; |
|
59 | - |
|
60 | - |
|
61 | - /** |
|
62 | - * @inheritdoc |
|
63 | - */ |
|
64 | - public function getSchemaPropertyNames(): array |
|
65 | - { |
|
66 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * @inheritdoc |
|
72 | - */ |
|
73 | - public function getSchemaPropertyExpectedTypes(): array |
|
74 | - { |
|
75 | - return [ |
|
76 | - 'additionalType' => ['URL'], |
|
77 | - 'alternateName' => ['Text'], |
|
78 | - 'description' => ['Text'], |
|
79 | - 'disambiguatingDescription' => ['Text'], |
|
80 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
81 | - 'image' => ['URL', 'ImageObject'], |
|
82 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
83 | - 'name' => ['Text'], |
|
84 | - 'potentialAction' => ['Action'], |
|
85 | - 'sameAs' => ['URL'], |
|
86 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
87 | - 'supersededBy' => ['Class', 'Property', 'Enumeration'], |
|
88 | - 'url' => ['URL'] |
|
89 | - ]; |
|
90 | - } |
|
91 | - |
|
92 | - |
|
93 | - /** |
|
94 | - * @inheritdoc |
|
95 | - */ |
|
96 | - public function getSchemaPropertyDescriptions(): array |
|
97 | - { |
|
98 | - return [ |
|
99 | - '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.', |
|
100 | - 'alternateName' => 'An alias for the item.', |
|
101 | - 'description' => 'A description of the item.', |
|
102 | - '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.', |
|
103 | - '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. ', |
|
104 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
105 | - '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.', |
|
106 | - 'name' => 'The name of the item.', |
|
107 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
108 | - '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.', |
|
109 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
110 | - 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', |
|
111 | - 'url' => 'URL of the item.' |
|
112 | - ]; |
|
113 | - } |
|
114 | - |
|
115 | - |
|
116 | - /** |
|
117 | - * @inheritdoc |
|
118 | - */ |
|
119 | - public function getGoogleRequiredSchema(): array |
|
120 | - { |
|
121 | - return ['description', 'name']; |
|
122 | - } |
|
123 | - |
|
124 | - |
|
125 | - /** |
|
126 | - * @inheritdoc |
|
127 | - */ |
|
128 | - public function getGoogleRecommendedSchema(): array |
|
129 | - { |
|
130 | - return ['image', 'url']; |
|
131 | - } |
|
132 | - |
|
133 | - |
|
134 | - /** |
|
135 | - * @inheritdoc |
|
136 | - */ |
|
137 | - public function defineRules(): array |
|
138 | - { |
|
139 | - $rules = parent::defineRules(); |
|
140 | - $rules = array_merge($rules, [ |
|
141 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
142 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
143 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
144 | - ]); |
|
145 | - |
|
146 | - return $rules; |
|
147 | - } |
|
27 | + use GameAvailabilityEnumerationTrait; |
|
28 | + use EnumerationTrait; |
|
29 | + use IntangibleTrait; |
|
30 | + use ThingTrait; |
|
31 | + |
|
32 | + /** |
|
33 | + * The Schema.org Type Name |
|
34 | + * |
|
35 | + * @var string |
|
36 | + */ |
|
37 | + public static string $schemaTypeName = 'GameAvailabilityEnumeration'; |
|
38 | + |
|
39 | + /** |
|
40 | + * The Schema.org Type Scope |
|
41 | + * |
|
42 | + * @var string |
|
43 | + */ |
|
44 | + public static string $schemaTypeScope = 'https://schema.org/GameAvailabilityEnumeration'; |
|
45 | + |
|
46 | + /** |
|
47 | + * The Schema.org Type Extends |
|
48 | + * |
|
49 | + * @var string |
|
50 | + */ |
|
51 | + public static string $schemaTypeExtends = 'Enumeration'; |
|
52 | + |
|
53 | + /** |
|
54 | + * The Schema.org Type Description |
|
55 | + * |
|
56 | + * @var string |
|
57 | + */ |
|
58 | + public static string $schemaTypeDescription = 'For a [[VideoGame]], such as used with a [[PlayGameAction]], an enumeration of the kind of game availability offered. '; |
|
59 | + |
|
60 | + |
|
61 | + /** |
|
62 | + * @inheritdoc |
|
63 | + */ |
|
64 | + public function getSchemaPropertyNames(): array |
|
65 | + { |
|
66 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * @inheritdoc |
|
72 | + */ |
|
73 | + public function getSchemaPropertyExpectedTypes(): array |
|
74 | + { |
|
75 | + return [ |
|
76 | + 'additionalType' => ['URL'], |
|
77 | + 'alternateName' => ['Text'], |
|
78 | + 'description' => ['Text'], |
|
79 | + 'disambiguatingDescription' => ['Text'], |
|
80 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
81 | + 'image' => ['URL', 'ImageObject'], |
|
82 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
83 | + 'name' => ['Text'], |
|
84 | + 'potentialAction' => ['Action'], |
|
85 | + 'sameAs' => ['URL'], |
|
86 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
87 | + 'supersededBy' => ['Class', 'Property', 'Enumeration'], |
|
88 | + 'url' => ['URL'] |
|
89 | + ]; |
|
90 | + } |
|
91 | + |
|
92 | + |
|
93 | + /** |
|
94 | + * @inheritdoc |
|
95 | + */ |
|
96 | + public function getSchemaPropertyDescriptions(): array |
|
97 | + { |
|
98 | + return [ |
|
99 | + '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.', |
|
100 | + 'alternateName' => 'An alias for the item.', |
|
101 | + 'description' => 'A description of the item.', |
|
102 | + '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.', |
|
103 | + '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. ', |
|
104 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
105 | + '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.', |
|
106 | + 'name' => 'The name of the item.', |
|
107 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
108 | + '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.', |
|
109 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
110 | + 'supersededBy' => 'Relates a term (i.e. a property, class or enumeration) to one that supersedes it.', |
|
111 | + 'url' => 'URL of the item.' |
|
112 | + ]; |
|
113 | + } |
|
114 | + |
|
115 | + |
|
116 | + /** |
|
117 | + * @inheritdoc |
|
118 | + */ |
|
119 | + public function getGoogleRequiredSchema(): array |
|
120 | + { |
|
121 | + return ['description', 'name']; |
|
122 | + } |
|
123 | + |
|
124 | + |
|
125 | + /** |
|
126 | + * @inheritdoc |
|
127 | + */ |
|
128 | + public function getGoogleRecommendedSchema(): array |
|
129 | + { |
|
130 | + return ['image', 'url']; |
|
131 | + } |
|
132 | + |
|
133 | + |
|
134 | + /** |
|
135 | + * @inheritdoc |
|
136 | + */ |
|
137 | + public function defineRules(): array |
|
138 | + { |
|
139 | + $rules = parent::defineRules(); |
|
140 | + $rules = array_merge($rules, [ |
|
141 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
142 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
143 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
144 | + ]); |
|
145 | + |
|
146 | + return $rules; |
|
147 | + } |
|
148 | 148 | } |